Welcome to the new Golem Cloud Docs! 👋
Documentation
API Definition

Api Definition API

Upload an OpenAPI definition

PathMethodProtected
/v1/api/definitions/importPUTNo

Uploads an OpenAPI JSON document and either creates a new one or updates an existing Golem API definition using it.

Example Request JSON

null

Example Response JSON

{
  "id": "string",
  "version": "string",
  "routes": [
    {
      "method": "Get",
      "path": "string",
      "binding": {
        "componentId": "616ccd92-d666-4180-8349-8d125b269fac",
        "workerName": "string",
        "idempotencyKey": "string",
        "response": "string"
      }
    }
  ],
  "draft": true
}

Get or list API definitions

PathMethodProtected
/v1/api/definitionsGETNo

If api_definition_id is specified, returns a single API definition. Otherwise lists all API definitions.

Query Parameters

NameTypeRequiredDescription
api-definition-idstringNo-

Example Response JSON

[
  {
    "id": "string",
    "version": "string",
    "routes": [
      {
        "method": "Get",
        "path": "string",
        "binding": {
          "componentId": "616ccd92-d666-4180-8349-8d125b269fac",
          "workerName": "string",
          "idempotencyKey": "string",
          "response": "string"
        }
      }
    ],
    "draft": true
  }
]

Create a new API definition

PathMethodProtected
/v1/api/definitionsPOSTNo

Creates a new API definition described by Golem's API definition JSON document. If an API definition of the same version already exists, its an error.

Example Request JSON

{
  "id": "string",
  "version": "string",
  "routes": [
    {
      "method": "Get",
      "path": "string",
      "binding": {
        "componentId": "616ccd92-d666-4180-8349-8d125b269fac",
        "workerName": "string",
        "idempotencyKey": "string",
        "response": "string"
      }
    }
  ],
  "draft": true
}

Example Response JSON

{
  "id": "string",
  "version": "string",
  "routes": [
    {
      "method": "Get",
      "path": "string",
      "binding": {
        "componentId": "616ccd92-d666-4180-8349-8d125b269fac",
        "workerName": "string",
        "idempotencyKey": "string",
        "response": "string"
      }
    }
  ],
  "draft": true
}

Get an API definition

PathMethodProtected
/v1/api/definitions/{id}/{version}GETNo

An API definition is selected by its API definition ID and version.

Example Response JSON

{
  "id": "string",
  "version": "string",
  "routes": [
    {
      "method": "Get",
      "path": "string",
      "binding": {
        "componentId": "616ccd92-d666-4180-8349-8d125b269fac",
        "workerName": "string",
        "idempotencyKey": "string",
        "response": "string"
      }
    }
  ],
  "draft": true
}

Update an existing API definition.

PathMethodProtected
/v1/api/definitions/{id}/{version}PUTNo

Only draft API definitions can be updated.

Example Request JSON

{
  "id": "string",
  "version": "string",
  "routes": [
    {
      "method": "Get",
      "path": "string",
      "binding": {
        "componentId": "616ccd92-d666-4180-8349-8d125b269fac",
        "workerName": "string",
        "idempotencyKey": "string",
        "response": "string"
      }
    }
  ],
  "draft": true
}

Example Response JSON

{
  "id": "string",
  "version": "string",
  "routes": [
    {
      "method": "Get",
      "path": "string",
      "binding": {
        "componentId": "616ccd92-d666-4180-8349-8d125b269fac",
        "workerName": "string",
        "idempotencyKey": "string",
        "response": "string"
      }
    }
  ],
  "draft": true
}

Delete an API definition

PathMethodProtected
/v1/api/definitions/{id}/{version}DELETENo

Deletes an API definition by its API definition ID and version.

Example Response JSON

"string"

Api Definition API Errors

Status CodeDescriptionBody
400{"type":"Messages","errors":["string"]}
401{"error":"string"}
403{"error":"string"}
404{"error":"string"}
409"string"
500{"error":"string"}