Save a file in a tool's draft
curl --request PUT \
--url https://api.pomerado.ai/v1/code/{id}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"content": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({path: '<string>', content: '<string>'})
};
fetch('https://api.pomerado.ai/v1/code/{id}/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pomerado.ai/v1/code/{id}/draft"
payload = {
"path": "<string>",
"content": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"draft": {
"base_version": 123,
"digest": "<string>",
"changed": [
"<string>"
],
"updated_at": "<string>",
"updated_by": {
"user_id": "<string>",
"name": "<string>",
"email": "<string>"
},
"passed_at": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}Tools and integrations
Save a file in a tool's draft
Save one file of your team’s draft of the code of a tool your team built.
PUT
/
v1
/
code
/
{id}
/
draft
Save a file in a tool's draft
curl --request PUT \
--url https://api.pomerado.ai/v1/code/{id}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"content": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({path: '<string>', content: '<string>'})
};
fetch('https://api.pomerado.ai/v1/code/{id}/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pomerado.ai/v1/code/{id}/draft"
payload = {
"path": "<string>",
"content": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"draft": {
"base_version": 123,
"digest": "<string>",
"changed": [
"<string>"
],
"updated_at": "<string>",
"updated_by": {
"user_id": "<string>",
"name": "<string>",
"email": "<string>"
},
"passed_at": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"docs_url": "<string>",
"details": {}
}
}Details
Details
- Business accounts only, with tools:build. Every member sees the draft with code.get.
- One draft per tool, shared by the team. Each save changes one file, and the last save of a file wins.
- content null deletes the file. A file saved back to its text in the draft’s base version leaves the draft, and a draft with no change left is deleted.
- Only files under src/, test/ and explore/ change, and an entrypoint can’t be deleted. A public tool’s code is read only, so a save to it is forbidden.
- Callers: an API key, an MCP OAuth token or a Dashboard session.
-
Permission:
tools:build. - Effect: Creates or changes something.
-
Errors:
business_account_required,not_found, and the errors any request can get.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
a tool ID: tool_ and 32 lowercase hex digits
Example:
"tool_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190"
Body
application/json
Response
The tool's draft after the save
The tool's draft after the save, or null when no change is left in it
Show child attributes
Show child attributes