API Specs
5 endpoints
Read specifications and their versions, export them as OpenAPI, and record which version a deployment put into an environment.
List the specifications of a project
GET /api/projects/{projectId}/specs
Returns the specifications of a project together with the number of their latest published version, so a pipeline can resolve a spec by name and see at a glance what is live.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-RB-Region |
header | string | no | Region of your organization. US organizations must send us; EU organizations leave the header out. Without it a US call is routed to the EU region and answered with 401. |
Responses
200 — A page of specifications.
| Property | Type | Required | Description |
|---|---|---|---|
items |
ApiSpec[] | yes | The specifications on this page. |
totalCount |
integer (int32) | yes | Total number of specifications in the project, ignoring paging. |
401 — The API key is missing, invalid, expired or revoked. A US organization calling
without X-RB-Region: us also lands here, because the request reached the wrong
region.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
403 — The key is valid but lacks the permission or the project scope for this call.
A scoped key is also refused on organization level operations by design.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
404 — The resource does not exist, or it belongs to another organization or project.
Both cases answer the same way on purpose, so the API cannot be used to probe for foreign identifiers.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
429 — The rate limit was exceeded. The Retry-After header gives the seconds to wait.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
List the versions of a specification
GET /api/projects/{projectId}/specs/{specId}/versions
Returns the versions of a specification with their status and publish target.
Only a version whose status is published is frozen, so anything else can still
change underneath you.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-RB-Region |
header | string | no | Region of your organization. US organizations must send us; EU organizations leave the header out. Without it a US call is routed to the EU region and answered with 401. |
Responses
200 — A page of versions.
| Property | Type | Required | Description |
|---|---|---|---|
items |
SpecVersion[] | yes | The versions on this page. |
totalCount |
integer (int32) | yes | Total number of versions of this specification, ignoring paging. |
401 — The API key is missing, invalid, expired or revoked. A US organization calling
without X-RB-Region: us also lands here, because the request reached the wrong
region.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
403 — The key is valid but lacks the permission or the project scope for this call.
A scoped key is also refused on organization level operations by design.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
404 — The resource does not exist, or it belongs to another organization or project.
Both cases answer the same way on purpose, so the API cannot be used to probe for foreign identifiers.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
429 — The rate limit was exceeded. The Retry-After header gives the seconds to wait.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
Export the current state of a specification
GET /api/projects/{projectId}/specs/{specId}/export
Returns the working state of a specification as OpenAPI, which is the draft as it stands in the designer right now. To export something stable, export a published version instead.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-RB-Region |
header | string | no | Region of your organization. US organizations must send us; EU organizations leave the header out. Without it a US call is routed to the EU region and answered with 401. |
Responses
200 — The specification document.
401 — The API key is missing, invalid, expired or revoked. A US organization calling
without X-RB-Region: us also lands here, because the request reached the wrong
region.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
403 — The key is valid but lacks the permission or the project scope for this call.
A scoped key is also refused on organization level operations by design.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
404 — The resource does not exist, or it belongs to another organization or project.
Both cases answer the same way on purpose, so the API cannot be used to probe for foreign identifiers.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
429 — The rate limit was exceeded. The Retry-After header gives the seconds to wait.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
Export a published version
GET /api/projects/{projectId}/specs/{specId}/versions/{versionId}/export
Returns a published version as a downloadable OpenAPI document. A published version is frozen, so the same call returns the same bytes forever, which makes it safe to generate clients from in a build.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-RB-Region |
header | string | no | Region of your organization. US organizations must send us; EU organizations leave the header out. Without it a US call is routed to the EU region and answered with 401. |
Responses
200 — The specification document as a file.
401 — The API key is missing, invalid, expired or revoked. A US organization calling
without X-RB-Region: us also lands here, because the request reached the wrong
region.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
403 — The key is valid but lacks the permission or the project scope for this call.
A scoped key is also refused on organization level operations by design.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
404 — The resource does not exist, or it belongs to another organization or project.
Both cases answer the same way on purpose, so the API cannot be used to probe for foreign identifiers.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
429 — The rate limit was exceeded. The Retry-After header gives the seconds to wait.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
Record that a version went into an environment
POST /api/projects/{projectId}/specs/{specId}/versions/{versionId}/promote
Tells Routebase which version an environment now serves. The intended order is that your pipeline deploys first and then makes this call, so the pin reflects what is actually running rather than what someone intended.
A call authenticated with an API key is recorded with source cli, which is how
a pipeline assertion is told apart from someone clicking in the UI. If the target
environment freezes versions, the promoted version becomes immutable here.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key |
header | string | no | Makes a retry of this write safe. Send a new value of 1 to 255 characters for each logical request and the same value on every retry. A successful result is kept for 24 hours, and a retry within that time returns it with the Idempotency-Replayed header instead of running the request again. |
X-RB-Region |
header | string | no | Region of your organization. US organizations must send us; EU organizations leave the header out. Without it a US call is routed to the EU region and answered with 401. |
Request body
Required.
Content type: application/json
| Property | Type | Required | Description |
|---|---|---|---|
environmentId |
string (uuid) | yes | Environment the version was deployed to. |
publishTarget |
PublishTarget | null | no |
impactAcknowledged |
boolean | null | no |
Responses
200 — The promotion was recorded.
| Property | Type | Required | Description |
|---|---|---|---|
promotionId |
string (uuid) | yes | Public id of this promotion record, which the audit trail refers to. |
environmentId |
string (uuid) | yes | Public id of the environment the version went into. |
environmentName |
string | yes | Display name of that environment. |
versionId |
string (uuid) | yes | Public id of the promoted version. |
versionNumber |
string | yes | Version label of the promoted version. |
frozeVersion |
boolean | yes | Whether this promotion made the version immutable. |
previousVersionNumber |
string | null | no |
source |
PinSource | yes | How the pin was set. A call with an API key is recorded as cli. |
isRollback |
boolean | yes | Whether the pin moved back to a version the environment served earlier. |
400 — The request was malformed or failed validation.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
401 — The API key is missing, invalid, expired or revoked. A US organization calling
without X-RB-Region: us also lands here, because the request reached the wrong
region.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
403 — The key is valid but lacks the permission or the project scope for this call.
A scoped key is also refused on organization level operations by design.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
404 — The resource does not exist, or it belongs to another organization or project.
Both cases answer the same way on purpose, so the API cannot be used to probe for foreign identifiers.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
409 — The promotion is blocked. The most common reason is an unacknowledged impact
on dependent services, which you clear by sending impactAcknowledged.
With an Idempotency-Key, a 409 can also mean that a request with this key is still running or that its response was too large to keep. The code is then IDEMPOTENCY_KEY_IN_PROGRESS or IDEMPOTENCY_RESPONSE_NOT_STORED.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
422 — This Idempotency-Key was already used with a different request body, so use a new key. The code is IDEMPOTENCY_KEY_REUSED.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |
429 — The rate limit was exceeded. The Retry-After header gives the seconds to wait.
| Property | Type | Required | Description |
|---|---|---|---|
type |
string | no | A URI identifying the problem type. |
title |
string | no | A short summary of the problem type. |
status |
integer (int32) | yes | The HTTP status code. |
detail |
string | no | A human readable explanation. |
instance |
string | no | The path that produced the error. |
code |
string | no | The stable machine readable error code, for example CONCURRENCY_CONFLICT, PROJECT_LOCKED, API_KEY_SCOPE_DENIED or NOT_A_MEMBER. |