Admiral

Sources

Create a source

POST
/v1/sources
  • An integration grant is checked here, with no network call. The integration must be a CONNECTED GitHub integration of this organization and the location must be a repository its installation reaches: under the installation's account, and in its repository list when the selection is SELECTED. FAILED_PRECONDITION otherwise, naming which.
    • A credential grant is checked at fetch, the way an import is, since a credential carries hosts and never repositories. The credential must exist in this organization and allow the location's host. FAILED_PRECONDITION when it does not.

ALREADY_EXISTS when the organization has a source of this name.

Scope: source:write

Authorization

bearerAuth
AuthorizationBearer <token>

An API key, or an access token minted from one. Pass it in the Authorization header: Bearer admp_...

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/v1/sources" \  -H "Content-Type: application/json" \  -d '{    "source": {}  }'
{  "source": {    "id": "string",    "name": "string",    "description": "string",    "kind": "KIND_UNSPECIFIED",    "location": "string",    "trigger": "TRIGGER_UNSPECIFIED",    "allows": [      "string"    ],    "settings": {      "git": {        "branches": [          "string"        ],        "pull_request_comment": "PULL_REQUEST_COMMENT_UNSPECIFIED"      }    },    "status": "STATUS_UNSPECIFIED",    "status_reason": "string",    "created_by": {      "id": "string",      "display_name": "string",      "email": "string"    },    "created_at": "2023-01-15T01:30:15.01Z",    "updated_at": "2023-01-15T01:30:15.01Z",    "credential_id": "string"  }}