Key Value API
1
4fbf02fc-0329-4291-aac3-0143969167c4
Promise API
2
4fbf02fc-0329-4291-aac3-0143969167c4
Worker API
8
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Token API
7
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Template API
6
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Project policy API
5
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Project grant API
4
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Project API
3
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Login API
2
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Account API
1
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Breaking changes August 2023
1
726cfb0b-bffe-41ba-98b4-94069569ec3c
Overview
0
726cfb0b-bffe-41ba-98b4-94069569ec3c
Tier 4 languages
4
03501aa5-572b-4129-aa0a-9e9fe9f5d3fc
Python
4
54bda586-0bf3-430e-93e5-6d8c578372bd
Overview
0
ac8f610e-7e8f-465d-9e32-4b6ae0aba3b5
Overview
0
0f58ad57-8cb7-4a64-8aed-c7bea90c37f9
Overview
0
03501aa5-572b-4129-aa0a-9e9fe9f5d3fc
Overview
0
54bda586-0bf3-430e-93e5-6d8c578372bd
Overview
0
9b92ca64-009f-47e8-9457-b544f786d8af
Quickstart
2
1d167981-dd90-40ab-8023-3b2013ceb5c5
Overview
0
1aa11fd4-1dcf-4c87-8b46-5c15ca815d61
Overview
0
4fbf02fc-0329-4291-aac3-0143969167c4
Overview
0
d0be080a-56f4-481a-91d3-ba7d30c144f4
Common tooling
1
03501aa5-572b-4129-aa0a-9e9fe9f5d3fc
C
3
54bda586-0bf3-430e-93e5-6d8c578372bd
Go
2
54bda586-0bf3-430e-93e5-6d8c578372bd
Grain
3
9b92ca64-009f-47e8-9457-b544f786d8af
Swift
1
9b92ca64-009f-47e8-9457-b544f786d8af
C#
3
9b92ca64-009f-47e8-9457-b544f786d8af
Zig
2
9b92ca64-009f-47e8-9457-b544f786d8af
Rust
1
54bda586-0bf3-430e-93e5-6d8c578372bd
Overview
0
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Overview
0
62133a19-c114-4a29-a74b-f986d118e157
Why Golem?
1
1d167981-dd90-40ab-8023-3b2013ceb5c5
Overview
0
1d167981-dd90-40ab-8023-3b2013ceb5c5
API Gateway
308adf1f-525e-460e-81c9-6ea00d1dbca4
d0be080a-56f4-481a-91d3-ba7d30c144f4
4
Release notes
726cfb0b-bffe-41ba-98b4-94069569ec3c
d0be080a-56f4-481a-91d3-ba7d30c144f4
9
Component interface
ac8f610e-7e8f-465d-9e32-4b6ae0aba3b5
d0be080a-56f4-481a-91d3-ba7d30c144f4
7
Getting Started
1d167981-dd90-40ab-8023-3b2013ceb5c5
d0be080a-56f4-481a-91d3-ba7d30c144f4
1
Building Components
03501aa5-572b-4129-aa0a-9e9fe9f5d3fc
d0be080a-56f4-481a-91d3-ba7d30c144f4
2
Tier 2 languages
54bda586-0bf3-430e-93e5-6d8c578372bd
03501aa5-572b-4129-aa0a-9e9fe9f5d3fc
2
Promises
62133a19-c114-4a29-a74b-f986d118e157
d0be080a-56f4-481a-91d3-ba7d30c144f4
3
Tier 3 languages
9b92ca64-009f-47e8-9457-b544f786d8af
03501aa5-572b-4129-aa0a-9e9fe9f5d3fc
3
Golem CLI
1aa11fd4-1dcf-4c87-8b46-5c15ca815d61
d0be080a-56f4-481a-91d3-ba7d30c144f4
4
REST API
fc0b5887-cca5-4261-b6b7-73711f6f23b0
d0be080a-56f4-481a-91d3-ba7d30c144f4
5
Runtime API
4fbf02fc-0329-4291-aac3-0143969167c4
d0be080a-56f4-481a-91d3-ba7d30c144f4
6
FAQ
0f58ad57-8cb7-4a64-8aed-c7bea90c37f9
d0be080a-56f4-481a-91d3-ba7d30c144f4
7

Template API

fc0b5887-cca5-4261-b6b7-73711f6f23b0

Template API

Summary

The template API provides endpoint to upload, download and find Golem templates (WASM files with associated metadata).

Get the metadata of a template’s all versions

MethodPathRequestResponse
GET/v1/templates/{template_id}-Array of Template JSON

Response format:

[

{

"versionedTemplateId": {

"rawTemplateId": "70ff8f69-e121-40ea-b59a-b17526f37a78",

"version": 0

},

"userTemplateId": {

"versionedComponentId": {

"rawTemplateId": "70ff8f69-e121-40ea-b59a-b17526f37a78",

"version": 0

}

},

"protectedTemplateId": {

"versionedComponentId": {

"rawTemplateId": "70ff8f69-e121-40ea-b59a-b17526f37a78",

"version": 0

}

},

"templateName": {

"value": "test-template-1"

},

"templateSize": 329006,

"metadata": {

"exports": [

{

"Function": {

"name": "run",

"parameters": [],

"results": []

}

}

],

"producers": [

{

"fields": [

{

"name": "language",

"values": [

{

"name": "Rust",

"version": ""

}

]

},

{

"name": "processed-by",

"values": [

{

"name": "rustc",

"version": "1.71.0 (8ede3aae2 2023-07-12)"

},

{

"name": "clang",

"version": "15.0.6"

},

{

"name": "wit-component",

"version": "0.14.0"

},

{

"name": "wit-bindgen-rust",

"version": "0.11.0"

}

]

}

]

},

},

"projectId": "866e1f4a-cf1a-40aa-ad8f-77e33294e999"

},

...

}

Explanation

Each template can have multiple versions. Every time a new WASM is uploaded for a given template id, that creates a new version.

This endpoint returns a list of all versions for the template id provided as part of the URL. Each element of the response describes a single version of a template, but does not contain the binary (WASM) itself:

  • versionedTemplateId associates a specific version with the template id
  • userTemplateId and protectedTemplateId are implementation details, not used elsewhere on the public API
  • templateName is the human-readable name of the template
  • templateSize is the WASM binary’s size in bytes
  • metadata contains information extracted from the WASM itself:

Example cURL:

curl 'https://release.api.golem.cloud/v1/templates/70ff8f69-e121-40ea-b59a-b17526f37a78'

-H 'Authorization: Bearer 03f17466-202f-43ac-86cc-52e6c6a42d2d'

Update a template

MethodPathRequestResponse
PUT/v1/templates/{template_id}/uploadapplication/octet-streamTemplate JSON

Request format

The request body contains the new version of the template as a binary WASM stream

Response format

The response is a JSON containing the updated template metadata as described in above in the get metadata endpoint’s description.

Example cURL:

curl -X PUT

'https://release.api.golem.cloud/v1/templates/70ff8f69-e121-40ea-b59a-b17526f37a78/upload'

-H 'Content-Type: application/octet-stream'

--data-binary @new-template.wasm

-H 'Authorization: Bearer 03f17466-202f-43ac-86cc-52e6c6a42d2d'

Get all templates of a project

MethodPathRequestResponse
GET/v1/templates?projectId={projectId}-Array of Template JSON

Response format:

Same array of Template JSON as described above at the get all template metadata by id endpoint.

Explanation

Gets all templates belonging to the given project

Example cURL:

curl 'https://release.api.golem.cloud/v1/templates?projectId=866e1f4a-cf1a-40aa-ad8f-77e33294e999'

-H 'Authorization: Bearer 03f17466-202f-43ac-86cc-52e6c6a42d2d'

Get templates in a project with a given name

MethodPathRequestResponse
GET/v1/templates?project-id={projectId}&template-name={templateName}-Array of Template JSON

Response format:

Same array of Template JSON as described above at the get all template metadata by id endpoint.

Explanation

Gets all templates belonging to the given project with a given name. Because the uniqueness of a template’s name is not enforced, the response may contain templates with different template ids.

Example cURL:

curl 'https://release.api.golem.cloud/v1/templates?project-id=866e1f4a-cf1a-40aa-ad8f-77e33294e999?template-name=test'

-H 'Authorization: Bearer 03f17466-202f-43ac-86cc-52e6c6a42d2d'

Upload a new template

MethodPathRequestResponse
POST/v1/templatesmultipart/form-dataTemplate JSON

Request format

The request body is encoded as multipart/form-data with the following fields:

  • field0 with content type application/json containing a TemplateQuery JSON (described below)
  • template with content type application/octet-stream containing the WASM

The JSON passed in the field0 field has the following format:

{

"projectId": "866e1f4a-cf1a-40aa-ad8f-77e33294e999",

"componentName": "test-template"

}

The projectId is optional, in case it is missing the default project is used.

Response format

The response is a JSON containing the updated template metadata as described in above in the get metadata endpoint’s description.

Example cURL:

curl -X POST

'https://release.api.golem.cloud/v1/templates'

-H 'Content-Type: multipart/form-data'

-F 'field0={"componentName": "test-template"}; type=application/json'

-F 'componentName=@new-template.wasm; type=application/octet-stream'

-H 'Authorization: Bearer 03f17466-202f-43ac-86cc-52e6c6a42d2d'

Download a template

MethodPathRequestResponse
GET/v1/templates/{template_id}/download?version={version}-application/octet-stream WASM

Response format:

Same array of Template JSON as described above at the get all template metadata by id endpoint.

Explanation

Downloads a specific version of the template’s WASM.

Example cURL:

curl 'https://release.api.golem.cloud/v1/templates/70ff8f69-e121-40ea-b59a-b17526f37a78/download

-H 'Authorization: Bearer 03f17466-202f-43ac-86cc-52e6c6a42d2d'

Get the latest version of a given template

MethodPathRequestResponse
GET/v1/templates/{template_id}/latest-JSON number

Response format:

The latest version number of the template, as a JSON number.

Explanation

Gets the latest version of a template.

Example cURL:

curl 'https://release.api.golem.cloud/v1/templates/70ff8f69-e121-40ea-b59a-b17526f37a78/latest'

-H 'Authorization: Bearer 03f17466-202f-43ac-86cc-52e6c6a42d2d'

Template API errors

All template endpoints can return with the following errors:

StatusBodyDescription
400{ "errors": ["error1", ...] }Invalid request, returning with a list of issues detected in the request.
401{ "error": "..." }Unauthorized
403{ "error": "..." }Maximum number of templates exceeded
404{ "message": "..." }Template not found
409{ "component_id": "..." }Template already exists
500{ "error": "..." }Internal server error