Skip to main content
POST
/
unstable
/
models
/
{modelId}
/
yaml
Create or update YAML files
curl --request POST \
  --url https://{instance}.omniapp.co/api/unstable/models/{modelId}/yaml \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fileName": "<string>",
  "yaml": "<string>",
  "mode": "combined",
  "branchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "commitMessage": "<string>",
  "previousChecksum": "<string>"
}
'
{
  "fileName": "<string>",
  "success": true
}
This API is in beta and may have future breaking changes.

Authorizations

Authorization
string
header
required

Can be either an Organization API Key or Personal Access Token (PAT).

Include in the Authorization header as: Bearer YOUR_TOKEN

Path Parameters

modelId
string<uuid>
required

The ID of the model.

Body

application/json
fileName
string
required

The name of the YAML file. Valid values are:

yaml
string
required

The YAML contents of the file. This can be empty, in which case:

  • If empty and used with mode: extension the file will be removed from the model
  • If empty and used with mode: combined, the file will be ignored in the model
mode
enum<string>
default:combined
required

The mode to use when creating or overwriting the YAML file.

Note: Workbook models must use combined mode if there is a branchId.

Available options:
combined,
extension,
staged
branchId
string<uuid>

Required if git pull requests are required for the model. The ID of the branch to create or update.

commitMessage
string

Required for git-enabled models. Commit message describing the change.

previousChecksum
string

Checksum of the file when fetched, for conflict detection. Obtain this value from the Get model YAML endpoint by including the includeChecksums parameter.

If the file has been modified since you fetched it, the request will fail with a File has been modified since it was fetched error.

Response

YAML file updated successfully

fileName
string

The name of the file that was created or updated.

success
boolean

Indicates the request was successful.