Skip to main content
POST
/
{org}
/
api-keys
Create API key
curl --request POST \
  --url https://api.mesa.dev/v1/{org}/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "scopes": [
    "read"
  ],
  "repo_ids": [
    "<string>"
  ],
  "expires_in_seconds": 15768050,
  "tags": {}
}
'
{
  "id": "<string>",
  "key": "<string>",
  "name": "<string>",
  "scopes": [
    "<string>"
  ],
  "repo_ids": [
    "<string>"
  ],
  "tags": {},
  "created_at": "2023-11-07T05:31:56Z"
}
Required scope: admin

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

org
string
required

Body

application/json
name
string
scopes
enum<string>[]
Available options:
read,
write,
admin
repo_ids
string[]
Minimum string length: 1
expires_in_seconds
integer

Expiration time in seconds. Must be between 100 and 31536000 (365 days).

Required range: 100 <= x <= 31536000
tags
object

Response

API key created

id
string
required
key
string
required
name
string | null
required
scopes
string[]
required
repo_ids
string[] | null
required
tags
object
required
created_at
string<date-time>
required