Docs
Dashboard
API reference / ProjectBeta

Create an API key

The key is in the response only (it is stored hashed). 20 per hour per project. With an Idempotency-Key, the response is replayed only to the same caller (the same API key or console login; anyone else gets 422), and revoking the key forgets it. 403 email_unconfirmed while every owner of the project's organization is a sign-up still held back until it enters its confirmation code.

POST/v1/project/api-keys

Request

Method and pathPOST/v1/project/api-keys
Base URLhttps://api.boxline.dev
AuthenticationYour API key in the x-api-key header (or Authorization: Bearer). The examples read it from BOXLINE_API_KEY.
Safe retriesSend an Idempotency-Key header to retry without creating anything twice. See Idempotency keys.
Rate limitYes. See Rate limits for the numbers and headers.

Headers

NameTypeDefaultAllowed valuesDescription
Idempotency-Keystring––Makes a retry safe: the same key and body within 24 hours returns the first response (with Idempotent-Replayed: true) instead of creating something twice. 1 to 255 printable ASCII characters without spaces, e.g. a UUID. Keys belong to the project (a new API key is replayed only to its caller). At most 300 new keys per minute per project (429). 1 to 255 characters.

Body

JSON with content-type: application/json. Optional: you can leave the body out.

NameTypeDefaultAllowed valuesDescription
namestringAPI key–Up to 80 characters.
curl -X POST "https://api.boxline.dev/v1/project/api-keys" \  -H "x-api-key: $BOXLINE_API_KEY" \  -H "content-type: application/json" \  -H "Idempotency-Key: $(uuidgen)" \  -d '{"name": "CI"}'

Responses

201 Created

The new key.

Headers

  • RateLimit-Limit: Requests allowed in the current window of this route's limit. (Rate limits)
  • RateLimit-Remaining: Requests left in the current window. (Rate limits)
  • RateLimit-Reset: Seconds until the window starts again. (Rate limits)
  • Idempotent-Replayed: true when this is the kept response of an earlier request with the same Idempotency-Key. (Idempotency keys)

Fields

NameTypeDefaultAllowed valuesDescription
idstring––
namestring––
prefixstring––
keystring––The key itself. Shown only in this response.
Response 201
{  "id": "…",  "name": "Work account",  "prefix": "…",  "key": "…"}

Errors

Errors have a matching HTTP status and the same body. code is stable, so check it in your code; message is for people. See Errors and request ids.

StatusCodesWhen
400 Bad Requestinvalid_request, invalid_json, invalid_cursor, invalid_idempotency_key, invalid_extension, variables_with_extensions, terms_not_accepted, invalid_reset_token, invalid_confirmation_code, wrong_password, no_password, invalid_next, invalid_oauth_tokenThe request is not valid.
401 UnauthorizedunauthorizedMissing or invalid API key.
403 Forbiddenproject_suspended, organization_suspended, role_forbidden, forbidden, extension_denied, cross_site_request, console_login_required, impersonating, invite_email_mismatch, email_unconfirmedNot allowed.
409 Conflictsession_not_running, shell_disabled, browser_disabled, nothing_saved, not_resumable, invalid_state, conflict, email_taken, identity_in_use, provider_already_linked, last_sign_in_method, not_impersonating, machine_too_old, too_many_credential_values, limit_reached, terms_version_mismatch, no_project, last_owner, organization_not_empty, project_has_sessions, already_member, invite_pending, idempotency_in_progressThe current state does not allow it, or a request with this Idempotency-Key is still being answered.
422 Unprocessable Contentidempotency_mismatchThis Idempotency-Key was already used for a different request.
429 Too Many Requestsrate_limited, concurrency_limitToo many requests, or the organization's concurrent sessions (its plan's) or the project's concurrencyCap are in use.
Error body
{  "error": {    "code": "not_found",    "message": "session not found",    "requestId": "req_4fJx0aQm2Lk9Pz7N"  }}

Learn more

These docs describe a beta API. Endpoints, fields and SDK methods may change before general availability; breaking changes will be listed in the changelog.