Attach a template workspace resource

Adds or replaces one bounded persistent read-only resource and advances the workspace revision.

POST
/v1/templates/{id}/workspace/resources

Adds or replaces one bounded persistent read-only resource and advances the workspace revision.

x-api-key<token>

In: header

Path Parameters

id*string
Match^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

expectedRevision*string
resource*
idempotencyKey*string
Length1 <= length <= 255

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/templates/string/workspace/resources" \  -H "Content-Type: application/json" \  -d '{    "expectedRevision": "string",    "resource": {      "resourceId": "string",      "name": "string",      "files": [        {          "path": "string",          "mediaType": "string",          "contentBase64": "string"        }      ]    },    "idempotencyKey": "string"  }'
{  "projectId": "string",  "organizationId": "string",  "ownerEpoch": 0,  "repositoryName": "string",  "defaultBranch": "string",  "baseCommit": "string",  "remoteHead": "string",  "pendingRemoteHead": "string",  "revision": "string",  "overlay": {    "property1": "string",    "property2": "string"  },  "conflicts": [    {      "path": "string",      "base": "string",      "draft": "string",      "main": "string"    }  ],  "provenance": {    "references": [      {        "kind": "string",        "digest": "string",        "locator": "string"      }    ]  },  "mounts": [    {      "kind": "project",      "root": "/project",      "access": "read-write"    }  ],  "libraryManifestDigest": "string",  "createdAt": "string",  "updatedAt": "string",  "createdBy": {    "userId": "string",    "via": "api"  },  "updatedBy": {    "userId": "string",    "via": "api"  }}