GitLab API

Use these operations to interact with the GitLab integration in Cortex.

Required permissions

Your API key must have the Configure integrations permission.

Operations

Retrieve configurations

get
Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Responses
get
/api/v1/gitlab/configurations
GET /api/v1/gitlab/configurations HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "configurations": [
    {
      "alias": "text",
      "groupNames": [
        "text"
      ],
      "hidePersonalProjects": true,
      "host": "text",
      "isDefault": true,
      "lastFour": "text"
    }
  ]
}

Retrieve default configuration

get
Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Responses
get
/api/v1/gitlab/default-configuration
GET /api/v1/gitlab/default-configuration HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "alias": "text",
  "groupNames": [
    "text"
  ],
  "hidePersonalProjects": true,
  "host": "text",
  "isDefault": true,
  "lastFour": "text"
}

Retrieve a configuration

get
Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Path parameters
aliasstringRequired
Responses
get
/api/v1/gitlab/configuration/{alias}
GET /api/v1/gitlab/configuration/{alias} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "alias": "text",
  "groupNames": [
    "text"
  ],
  "hidePersonalProjects": true,
  "host": "text",
  "isDefault": true,
  "lastFour": "text"
}

Add a single configuration

post
Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Body
aliasstringRequired
groupNamesstring[]Required
hidePersonalProjectsbooleanRequired
hoststringOptional
isDefaultbooleanRequired
personalAccessTokenstringRequired
Responses
post
/api/v1/gitlab/configuration
POST /api/v1/gitlab/configuration HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 126

{
  "alias": "text",
  "groupNames": [
    "text"
  ],
  "hidePersonalProjects": true,
  "host": "text",
  "isDefault": true,
  "personalAccessToken": "text"
}
{
  "configurations": [
    {
      "alias": "text",
      "groupNames": [
        "text"
      ],
      "hidePersonalProjects": true,
      "host": "text",
      "isDefault": true,
      "lastFour": "text"
    }
  ]
}

Validate all configurations

post
Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Responses
post
/api/v1/gitlab/configuration/validate
POST /api/v1/gitlab/configuration/validate HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "configurations": [
    {
      "alias": "text",
      "isValid": true,
      "message": "text"
    }
  ]
}

Validate a configuration

post
Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Path parameters
aliasstringRequired
Responses
post
/api/v1/gitlab/configuration/validate/{alias}
POST /api/v1/gitlab/configuration/validate/{alias} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "alias": "text",
  "isValid": true,
  "message": "text"
}

Update a configuration

put

WARNING: Updating aliases for configurations or changing the default configuration could cause entity YAMLs that use this integration to break.

Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Path parameters
aliasstringRequired
Body
aliasstringRequired
groupNamesstring[]Required
hidePersonalProjectsbooleanRequired
hoststringOptional
isDefaultbooleanRequired
Responses
put
/api/v1/gitlab/configuration/{alias}
PUT /api/v1/gitlab/configuration/{alias} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 97

{
  "alias": "text",
  "groupNames": [
    "text"
  ],
  "hidePersonalProjects": true,
  "host": "text",
  "isDefault": true
}
{
  "configurations": [
    {
      "alias": "text",
      "groupNames": [
        "text"
      ],
      "hidePersonalProjects": true,
      "host": "text",
      "isDefault": true,
      "lastFour": "text"
    }
  ]
}

Add multiple configurations

post
Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Body
Responses
post
/api/v1/gitlab/configurations
POST /api/v1/gitlab/configurations HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 147

{
  "configurations": [
    {
      "alias": "text",
      "groupNames": [
        "text"
      ],
      "hidePersonalProjects": true,
      "host": "text",
      "isDefault": true,
      "personalAccessToken": "text"
    }
  ]
}
{
  "configurations": [
    {
      "alias": "text",
      "groupNames": [
        "text"
      ],
      "hidePersonalProjects": true,
      "host": "text",
      "isDefault": true,
      "lastFour": "text"
    }
  ],
  "skippedConfigurations": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}

Delete all configurations

delete
Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Responses
delete
/api/v1/gitlab/configurations
DELETE /api/v1/gitlab/configurations HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Delete a configuration

delete
Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Path parameters
aliasstringRequired
Responses
delete
/api/v1/gitlab/configuration/{alias}
DELETE /api/v1/gitlab/configuration/{alias} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "configurations": [
    {
      "alias": "text",
      "groupNames": [
        "text"
      ],
      "hidePersonalProjects": true,
      "host": "text",
      "isDefault": true,
      "lastFour": "text"
    }
  ]
}

Last updated

Was this helpful?