> For the complete documentation index, see [llms.txt](https://docs.cortex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cortex.io/api/readme/scaffolders.md).

# Scaffolder

Use these operations to interact with [Scaffolder templates](/streamline/workflows/scaffolder.md) in Cortex.

### Required permissions

* List or retrieve Scaffolder templates: no additional permission is required.
* Create, update, or delete Scaffolder templates: your API key must have the `Configure Scaffolder` permission.

### Identifying a template

Every Scaffolder template has a `tag`: a stable, human-readable identifier that is unique within your workspace. Tags may contain lowercase letters, numbers, and dashes, and may not start or end with a dash. If you omit the tag when creating a template, Cortex derives one from the template's name. An existing template keeps its tag unless you supply a new one.

Operations that take a `tagOrId` path parameter accept either the tag or the unique, auto-generated Cortex ID. Prefer the tag: it is the identifier you choose, so it stays readable and portable across workspaces.

### Creating and updating

`POST /api/v1/scaffolders` is an upsert. If a template with the same tag already exists, that template is updated instead of a new one being created. Use `PUT /api/v1/scaffolders/{tagOrId}` when you want to update a specific template and have the request fail if it does not exist.

## Operations

## List Scaffolder templates

> List Scaffolder templates.

```json
{"openapi":"3.0.1","info":{"title":"Cortex API","version":"v1"},"tags":[{"name":"Scaffolder"}],"servers":[{"url":"https://api.getcortexapp.com","description":"Cortex Cloud API host"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","description":"All requests to the Cortex API need to provide an `Authorization: Bearer <token>` header, where `<token>` is an API key created in the Settings page of your workspace.","scheme":"bearer","type":"http"}},"schemas":{"ScaffolderListResponse":{"required":["page","scaffolders","total","totalPages"],"type":"object","properties":{"page":{"type":"integer","description":"Current page number, 0-indexed","format":"int32"},"scaffolders":{"type":"array","description":"List of Scaffolder templates","items":{"$ref":"#/components/schemas/ScaffolderResponse"}},"total":{"type":"integer","description":"Total number of results","format":"int32"},"totalPages":{"type":"integer","description":"Total number of pages","format":"int32"}}},"ScaffolderResponse":{"required":["createYamlFile","createdAt","id","labels","name","repoLocator","requireNewService","requirePullRequest","showReadme","strictAliasUsage","tag","type","updatedAt"],"type":"object","properties":{"createYamlFile":{"type":"boolean","description":"Whether a cortex.yaml is generated for the created entity"},"createdAt":{"type":"string","description":"ISO-8601 timestamp at which the template was registered"},"description":{"type":"string","description":"Description of the Scaffolder template"},"id":{"type":"string","description":"Unique, auto-generated Cortex ID of the Scaffolder template"},"labels":{"type":"array","description":"Descriptive labels used to group templates in the UI","items":{"type":"string","description":"Descriptive labels used to group templates in the UI"}},"name":{"type":"string","description":"Display name of the Scaffolder template"},"publisherOptions":{"oneOf":[{"$ref":"#/components/schemas/AzureDevops"},{"$ref":"#/components/schemas/Bitbucket"},{"$ref":"#/components/schemas/Github"},{"$ref":"#/components/schemas/Gitlab"}]},"repoLocator":{"oneOf":[{"$ref":"#/components/schemas/AzureDevops"},{"$ref":"#/components/schemas/Bitbucket"},{"$ref":"#/components/schemas/Github"},{"$ref":"#/components/schemas/Gitlab"}]},"requireNewService":{"type":"boolean","description":"Whether running the template must create a new entity"},"requirePullRequest":{"type":"boolean","description":"Whether the template publishes via a pull request to an existing repository"},"showReadme":{"type":"boolean","description":"Whether the template repository's README is shown before a run"},"strictAliasUsage":{"type":"boolean","description":"Whether runs are restricted to the git configuration alias the template names"},"tag":{"type":"string","description":"Stable, human-readable identifier, unique within the workspace"},"type":{"type":"string","description":"The templating engine of the template","enum":["COOKIECUTTER"]},"updatedAt":{"type":"string","description":"ISO-8601 timestamp at which the template was last updated"}}},"AzureDevops":{"required":["provider"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"}]},"ScaffolderPublisherOptions":{"required":["provider"],"type":"object","properties":{"provider":{"type":"string","description":"The git provider hosting the template repository","enum":["GITHUB","GITLAB","BITBUCKET","AZUREDEVOPS"]}},"description":"Options applied to the repository the Scaffolder publishes to","discriminator":{"propertyName":"provider"}},"Bitbucket":{"required":["provider"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"},{"type":"object","properties":{"visibility":{"type":"string","description":"Visibility of the created repository","enum":["PUBLIC","PRIVATE"]}}}]},"Github":{"required":["provider","sparseCheckout"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"},{"type":"object","properties":{"sparseCheckout":{"type":"boolean","description":"Whether the destination is cloned with sparse checkout"},"visibility":{"type":"string","description":"Visibility of the created repository","enum":["PUBLIC","PRIVATE"]}}}]},"Gitlab":{"required":["provider"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"},{"type":"object","properties":{"visibility":{"type":"string","description":"Visibility of the created repository","enum":["PUBLIC","PRIVATE"]}}}]},"ErrorResponse":{"required":["message","type"],"type":"object","properties":{"details":{"type":"string"},"errorCode":{"type":"string"},"gatewayHttpStatus":{"type":"integer","format":"int32"},"httpStatus":{"type":"integer","format":"int32"},"message":{"type":"string"},"requestId":{"type":"string"},"type":{"type":"string","enum":["INTEGRATION_MISSING","INTEGRATION_UNREGISTERED","INTEGRATION_UNSUPPORTED","INTEGRATION_GRAPHQL_ERROR","INTEGRATION_BAD_REQUEST","INTEGRATION_UNAUTHORIZED","INTEGRATION_FORBIDDEN","INTEGRATION_NOT_FOUND","INTEGRATION_UNPROCESSABLE_CONTENT","INTEGRATION_RATE_LIMITED","INTEGRATION_INTERNAL_ERROR","INTEGRATION_NOT_IMPLEMENTED","INTEGRATION_BAD_GATEWAY","INTEGRATION_UNAVAILABLE","INTEGRATION_GATEWAY_TIMEOUT","INTEGRATION_TIMED_OUT","INTEGRATION_CACHE_ERROR","INTEGRATION_UNHANDLED_HTTP_ERROR","INTEGRATION_UNHANDLED_EXCEPTION","INTEGRATION_UNEXPECTED_ERROR","ILLEGAL_ARGUMENT_ERROR","BAD_REQUEST","FORBIDDEN","NOT_FOUND","REQUEST_TIMEOUT","CONFLICT","UNHANDLED_EXCEPTION","UNCATEGORIZED","SERVICE_CREATOR","UNKNOWN_HOST","TOO_MANY_REQUESTS"]}}},"TooManyRequestsProblemDetail":{"required":["type","title","status"],"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string","format":"uri-reference"},"retryAfter":{"minimum":0,"type":"integer","description":"The number of seconds until the rate limiting resets.","format":"int32"},"status":{"maximum":599,"minimum":100,"type":"integer","format":"int32","enum":[429]},"title":{"type":"string"},"type":{"type":"string","format":"uri-reference"}}}},"responses":{"TooManyRequests":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/TooManyRequestsProblemDetail"}}},"description":"The client has exceeded the rate limit by performing too many requests in a short period. Retry the request after a delay.","headers":{"Retry-After":{"description":"The number of seconds until the rate limiting resets.","schema":{"minimum":0,"type":"integer","format":"int32"}}}}}},"paths":{"/api/v1/scaffolders":{"get":{"description":"List Scaffolder templates.","operationId":"listScaffolders","parameters":[{"description":"Number of results to return per page, between 1 and 1000. Default 250.","in":"query","name":"pageSize","required":true,"schema":{"type":"integer","format":"int32","default":250}},{"description":"Page number to return, 0-indexed. Default 0.","in":"query","name":"page","required":true,"schema":{"type":"integer","format":"int32","default":0}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaffolderListResponse"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/ScaffolderListResponse"}}},"description":"Successfully found Scaffolder templates"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Access denied"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"summary":"List Scaffolder templates","tags":["Scaffolder"]}}}}
```

## Retrieve Scaffolder template

> Retrieve a Scaffolder template by tag or Cortex ID.

```json
{"openapi":"3.0.1","info":{"title":"Cortex API","version":"v1"},"tags":[{"name":"Scaffolder"}],"servers":[{"url":"https://api.getcortexapp.com","description":"Cortex Cloud API host"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","description":"All requests to the Cortex API need to provide an `Authorization: Bearer <token>` header, where `<token>` is an API key created in the Settings page of your workspace.","scheme":"bearer","type":"http"}},"schemas":{"ScaffolderResponse":{"required":["createYamlFile","createdAt","id","labels","name","repoLocator","requireNewService","requirePullRequest","showReadme","strictAliasUsage","tag","type","updatedAt"],"type":"object","properties":{"createYamlFile":{"type":"boolean","description":"Whether a cortex.yaml is generated for the created entity"},"createdAt":{"type":"string","description":"ISO-8601 timestamp at which the template was registered"},"description":{"type":"string","description":"Description of the Scaffolder template"},"id":{"type":"string","description":"Unique, auto-generated Cortex ID of the Scaffolder template"},"labels":{"type":"array","description":"Descriptive labels used to group templates in the UI","items":{"type":"string","description":"Descriptive labels used to group templates in the UI"}},"name":{"type":"string","description":"Display name of the Scaffolder template"},"publisherOptions":{"oneOf":[{"$ref":"#/components/schemas/AzureDevops"},{"$ref":"#/components/schemas/Bitbucket"},{"$ref":"#/components/schemas/Github"},{"$ref":"#/components/schemas/Gitlab"}]},"repoLocator":{"oneOf":[{"$ref":"#/components/schemas/AzureDevops"},{"$ref":"#/components/schemas/Bitbucket"},{"$ref":"#/components/schemas/Github"},{"$ref":"#/components/schemas/Gitlab"}]},"requireNewService":{"type":"boolean","description":"Whether running the template must create a new entity"},"requirePullRequest":{"type":"boolean","description":"Whether the template publishes via a pull request to an existing repository"},"showReadme":{"type":"boolean","description":"Whether the template repository's README is shown before a run"},"strictAliasUsage":{"type":"boolean","description":"Whether runs are restricted to the git configuration alias the template names"},"tag":{"type":"string","description":"Stable, human-readable identifier, unique within the workspace"},"type":{"type":"string","description":"The templating engine of the template","enum":["COOKIECUTTER"]},"updatedAt":{"type":"string","description":"ISO-8601 timestamp at which the template was last updated"}}},"AzureDevops":{"required":["provider"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"}]},"ScaffolderPublisherOptions":{"required":["provider"],"type":"object","properties":{"provider":{"type":"string","description":"The git provider hosting the template repository","enum":["GITHUB","GITLAB","BITBUCKET","AZUREDEVOPS"]}},"description":"Options applied to the repository the Scaffolder publishes to","discriminator":{"propertyName":"provider"}},"Bitbucket":{"required":["provider"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"},{"type":"object","properties":{"visibility":{"type":"string","description":"Visibility of the created repository","enum":["PUBLIC","PRIVATE"]}}}]},"Github":{"required":["provider","sparseCheckout"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"},{"type":"object","properties":{"sparseCheckout":{"type":"boolean","description":"Whether the destination is cloned with sparse checkout"},"visibility":{"type":"string","description":"Visibility of the created repository","enum":["PUBLIC","PRIVATE"]}}}]},"Gitlab":{"required":["provider"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"},{"type":"object","properties":{"visibility":{"type":"string","description":"Visibility of the created repository","enum":["PUBLIC","PRIVATE"]}}}]},"ErrorResponse":{"required":["message","type"],"type":"object","properties":{"details":{"type":"string"},"errorCode":{"type":"string"},"gatewayHttpStatus":{"type":"integer","format":"int32"},"httpStatus":{"type":"integer","format":"int32"},"message":{"type":"string"},"requestId":{"type":"string"},"type":{"type":"string","enum":["INTEGRATION_MISSING","INTEGRATION_UNREGISTERED","INTEGRATION_UNSUPPORTED","INTEGRATION_GRAPHQL_ERROR","INTEGRATION_BAD_REQUEST","INTEGRATION_UNAUTHORIZED","INTEGRATION_FORBIDDEN","INTEGRATION_NOT_FOUND","INTEGRATION_UNPROCESSABLE_CONTENT","INTEGRATION_RATE_LIMITED","INTEGRATION_INTERNAL_ERROR","INTEGRATION_NOT_IMPLEMENTED","INTEGRATION_BAD_GATEWAY","INTEGRATION_UNAVAILABLE","INTEGRATION_GATEWAY_TIMEOUT","INTEGRATION_TIMED_OUT","INTEGRATION_CACHE_ERROR","INTEGRATION_UNHANDLED_HTTP_ERROR","INTEGRATION_UNHANDLED_EXCEPTION","INTEGRATION_UNEXPECTED_ERROR","ILLEGAL_ARGUMENT_ERROR","BAD_REQUEST","FORBIDDEN","NOT_FOUND","REQUEST_TIMEOUT","CONFLICT","UNHANDLED_EXCEPTION","UNCATEGORIZED","SERVICE_CREATOR","UNKNOWN_HOST","TOO_MANY_REQUESTS"]}}},"TooManyRequestsProblemDetail":{"required":["type","title","status"],"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string","format":"uri-reference"},"retryAfter":{"minimum":0,"type":"integer","description":"The number of seconds until the rate limiting resets.","format":"int32"},"status":{"maximum":599,"minimum":100,"type":"integer","format":"int32","enum":[429]},"title":{"type":"string"},"type":{"type":"string","format":"uri-reference"}}}},"responses":{"TooManyRequests":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/TooManyRequestsProblemDetail"}}},"description":"The client has exceeded the rate limit by performing too many requests in a short period. Retry the request after a delay.","headers":{"Retry-After":{"description":"The number of seconds until the rate limiting resets.","schema":{"minimum":0,"type":"integer","format":"int32"}}}}}},"paths":{"/api/v1/scaffolders/{tagOrId}":{"get":{"description":"Retrieve a Scaffolder template by tag or Cortex ID.","operationId":"getScaffolder","parameters":[{"description":"The tag or unique, auto-generated Cortex ID of the Scaffolder template.","in":"path","name":"tagOrId","required":true,"schema":{"type":"string","description":"Entity identifier - can be a tag or CID"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaffolderResponse"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/ScaffolderResponse"}}},"description":"Successfully found the Scaffolder template"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Access denied"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Scaffolder template not found"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"summary":"Retrieve Scaffolder template","tags":["Scaffolder"]}}}}
```

## Create or update Scaffolder template

> Create or update a Scaffolder template.\
> \
> API key must have the \`Configure Scaffolder\` permission.\
> \
> \*\*Note:\*\* If a Scaffolder template with the same tag already exists, it will be updated.

```json
{"openapi":"3.0.1","info":{"title":"Cortex API","version":"v1"},"tags":[{"name":"Scaffolder"}],"servers":[{"url":"https://api.getcortexapp.com","description":"Cortex Cloud API host"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","description":"All requests to the Cortex API need to provide an `Authorization: Bearer <token>` header, where `<token>` is an API key created in the Settings page of your workspace.","scheme":"bearer","type":"http"}},"schemas":{"ScaffolderRequest":{"required":["createYamlFile","labels","name","repoLocator","requireNewService","requirePullRequest","showReadme","strictAliasUsage","type"],"type":"object","properties":{"createYamlFile":{"type":"boolean","description":"Whether a cortex.yaml is generated for the created entity. Defaults to `true`"},"description":{"type":"string","description":"Description of the Scaffolder template"},"labels":{"type":"array","description":"Descriptive labels used to group templates in the UI","items":{"type":"string","description":"Descriptive labels used to group templates in the UI"}},"name":{"type":"string","description":"Display name of the Scaffolder template"},"publisherOptions":{"oneOf":[{"$ref":"#/components/schemas/AzureDevops"},{"$ref":"#/components/schemas/Bitbucket"},{"$ref":"#/components/schemas/Github"},{"$ref":"#/components/schemas/Gitlab"}]},"repoLocator":{"oneOf":[{"$ref":"#/components/schemas/AzureDevops"},{"$ref":"#/components/schemas/Bitbucket"},{"$ref":"#/components/schemas/Github"},{"$ref":"#/components/schemas/Gitlab"}]},"requireNewService":{"type":"boolean","description":"Whether running the template must create a new entity. Defaults to `true`"},"requirePullRequest":{"type":"boolean","description":"Whether the template publishes via a pull request to an existing repository. Defaults to `false`"},"showReadme":{"type":"boolean","description":"Whether the template repository's README is shown before a run. Defaults to `false`"},"strictAliasUsage":{"type":"boolean","description":"Whether runs are restricted to the git configuration alias the template names. Defaults to `true`"},"tag":{"type":"string","description":"Stable, human-readable identifier, unique within the workspace. Lowercase letters, numbers, and dashes; may not start or end with a dash. Derived from the name when omitted on creation; an existing template keeps its tag unless a new one is provided."},"type":{"type":"string","description":"The templating engine of the template","enum":["COOKIECUTTER"]}}},"AzureDevops":{"required":["provider"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"}]},"ScaffolderPublisherOptions":{"required":["provider"],"type":"object","properties":{"provider":{"type":"string","description":"The git provider hosting the template repository","enum":["GITHUB","GITLAB","BITBUCKET","AZUREDEVOPS"]}},"description":"Options applied to the repository the Scaffolder publishes to","discriminator":{"propertyName":"provider"}},"Bitbucket":{"required":["provider"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"},{"type":"object","properties":{"visibility":{"type":"string","description":"Visibility of the created repository","enum":["PUBLIC","PRIVATE"]}}}]},"Github":{"required":["provider","sparseCheckout"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"},{"type":"object","properties":{"sparseCheckout":{"type":"boolean","description":"Whether the destination is cloned with sparse checkout"},"visibility":{"type":"string","description":"Visibility of the created repository","enum":["PUBLIC","PRIVATE"]}}}]},"Gitlab":{"required":["provider"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"},{"type":"object","properties":{"visibility":{"type":"string","description":"Visibility of the created repository","enum":["PUBLIC","PRIVATE"]}}}]},"ScaffolderResponse":{"required":["createYamlFile","createdAt","id","labels","name","repoLocator","requireNewService","requirePullRequest","showReadme","strictAliasUsage","tag","type","updatedAt"],"type":"object","properties":{"createYamlFile":{"type":"boolean","description":"Whether a cortex.yaml is generated for the created entity"},"createdAt":{"type":"string","description":"ISO-8601 timestamp at which the template was registered"},"description":{"type":"string","description":"Description of the Scaffolder template"},"id":{"type":"string","description":"Unique, auto-generated Cortex ID of the Scaffolder template"},"labels":{"type":"array","description":"Descriptive labels used to group templates in the UI","items":{"type":"string","description":"Descriptive labels used to group templates in the UI"}},"name":{"type":"string","description":"Display name of the Scaffolder template"},"publisherOptions":{"oneOf":[{"$ref":"#/components/schemas/AzureDevops"},{"$ref":"#/components/schemas/Bitbucket"},{"$ref":"#/components/schemas/Github"},{"$ref":"#/components/schemas/Gitlab"}]},"repoLocator":{"oneOf":[{"$ref":"#/components/schemas/AzureDevops"},{"$ref":"#/components/schemas/Bitbucket"},{"$ref":"#/components/schemas/Github"},{"$ref":"#/components/schemas/Gitlab"}]},"requireNewService":{"type":"boolean","description":"Whether running the template must create a new entity"},"requirePullRequest":{"type":"boolean","description":"Whether the template publishes via a pull request to an existing repository"},"showReadme":{"type":"boolean","description":"Whether the template repository's README is shown before a run"},"strictAliasUsage":{"type":"boolean","description":"Whether runs are restricted to the git configuration alias the template names"},"tag":{"type":"string","description":"Stable, human-readable identifier, unique within the workspace"},"type":{"type":"string","description":"The templating engine of the template","enum":["COOKIECUTTER"]},"updatedAt":{"type":"string","description":"ISO-8601 timestamp at which the template was last updated"}}},"ErrorResponse":{"required":["message","type"],"type":"object","properties":{"details":{"type":"string"},"errorCode":{"type":"string"},"gatewayHttpStatus":{"type":"integer","format":"int32"},"httpStatus":{"type":"integer","format":"int32"},"message":{"type":"string"},"requestId":{"type":"string"},"type":{"type":"string","enum":["INTEGRATION_MISSING","INTEGRATION_UNREGISTERED","INTEGRATION_UNSUPPORTED","INTEGRATION_GRAPHQL_ERROR","INTEGRATION_BAD_REQUEST","INTEGRATION_UNAUTHORIZED","INTEGRATION_FORBIDDEN","INTEGRATION_NOT_FOUND","INTEGRATION_UNPROCESSABLE_CONTENT","INTEGRATION_RATE_LIMITED","INTEGRATION_INTERNAL_ERROR","INTEGRATION_NOT_IMPLEMENTED","INTEGRATION_BAD_GATEWAY","INTEGRATION_UNAVAILABLE","INTEGRATION_GATEWAY_TIMEOUT","INTEGRATION_TIMED_OUT","INTEGRATION_CACHE_ERROR","INTEGRATION_UNHANDLED_HTTP_ERROR","INTEGRATION_UNHANDLED_EXCEPTION","INTEGRATION_UNEXPECTED_ERROR","ILLEGAL_ARGUMENT_ERROR","BAD_REQUEST","FORBIDDEN","NOT_FOUND","REQUEST_TIMEOUT","CONFLICT","UNHANDLED_EXCEPTION","UNCATEGORIZED","SERVICE_CREATOR","UNKNOWN_HOST","TOO_MANY_REQUESTS"]}}},"TooManyRequestsProblemDetail":{"required":["type","title","status"],"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string","format":"uri-reference"},"retryAfter":{"minimum":0,"type":"integer","description":"The number of seconds until the rate limiting resets.","format":"int32"},"status":{"maximum":599,"minimum":100,"type":"integer","format":"int32","enum":[429]},"title":{"type":"string"},"type":{"type":"string","format":"uri-reference"}}}},"responses":{"TooManyRequests":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/TooManyRequestsProblemDetail"}}},"description":"The client has exceeded the rate limit by performing too many requests in a short period. Retry the request after a delay.","headers":{"Retry-After":{"description":"The number of seconds until the rate limiting resets.","schema":{"minimum":0,"type":"integer","format":"int32"}}}}}},"paths":{"/api/v1/scaffolders":{"post":{"description":"Create or update a Scaffolder template.\n\nAPI key must have the `Configure Scaffolder` permission.\n\n**Note:** If a Scaffolder template with the same tag already exists, it will be updated.","operationId":"createOrUpdateScaffolder","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaffolderRequest"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/ScaffolderRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaffolderResponse"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/ScaffolderResponse"}}},"description":"Scaffolder template created or updated successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Access denied"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"summary":"Create or update Scaffolder template","tags":["Scaffolder"]}}}}
```

## Update Scaffolder template

> Update a Scaffolder template by tag or Cortex ID.\
> \
> API key must have the \`Configure Scaffolder\` permission.

```json
{"openapi":"3.0.1","info":{"title":"Cortex API","version":"v1"},"tags":[{"name":"Scaffolder"}],"servers":[{"url":"https://api.getcortexapp.com","description":"Cortex Cloud API host"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","description":"All requests to the Cortex API need to provide an `Authorization: Bearer <token>` header, where `<token>` is an API key created in the Settings page of your workspace.","scheme":"bearer","type":"http"}},"schemas":{"ScaffolderRequest":{"required":["createYamlFile","labels","name","repoLocator","requireNewService","requirePullRequest","showReadme","strictAliasUsage","type"],"type":"object","properties":{"createYamlFile":{"type":"boolean","description":"Whether a cortex.yaml is generated for the created entity. Defaults to `true`"},"description":{"type":"string","description":"Description of the Scaffolder template"},"labels":{"type":"array","description":"Descriptive labels used to group templates in the UI","items":{"type":"string","description":"Descriptive labels used to group templates in the UI"}},"name":{"type":"string","description":"Display name of the Scaffolder template"},"publisherOptions":{"oneOf":[{"$ref":"#/components/schemas/AzureDevops"},{"$ref":"#/components/schemas/Bitbucket"},{"$ref":"#/components/schemas/Github"},{"$ref":"#/components/schemas/Gitlab"}]},"repoLocator":{"oneOf":[{"$ref":"#/components/schemas/AzureDevops"},{"$ref":"#/components/schemas/Bitbucket"},{"$ref":"#/components/schemas/Github"},{"$ref":"#/components/schemas/Gitlab"}]},"requireNewService":{"type":"boolean","description":"Whether running the template must create a new entity. Defaults to `true`"},"requirePullRequest":{"type":"boolean","description":"Whether the template publishes via a pull request to an existing repository. Defaults to `false`"},"showReadme":{"type":"boolean","description":"Whether the template repository's README is shown before a run. Defaults to `false`"},"strictAliasUsage":{"type":"boolean","description":"Whether runs are restricted to the git configuration alias the template names. Defaults to `true`"},"tag":{"type":"string","description":"Stable, human-readable identifier, unique within the workspace. Lowercase letters, numbers, and dashes; may not start or end with a dash. Derived from the name when omitted on creation; an existing template keeps its tag unless a new one is provided."},"type":{"type":"string","description":"The templating engine of the template","enum":["COOKIECUTTER"]}}},"AzureDevops":{"required":["provider"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"}]},"ScaffolderPublisherOptions":{"required":["provider"],"type":"object","properties":{"provider":{"type":"string","description":"The git provider hosting the template repository","enum":["GITHUB","GITLAB","BITBUCKET","AZUREDEVOPS"]}},"description":"Options applied to the repository the Scaffolder publishes to","discriminator":{"propertyName":"provider"}},"Bitbucket":{"required":["provider"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"},{"type":"object","properties":{"visibility":{"type":"string","description":"Visibility of the created repository","enum":["PUBLIC","PRIVATE"]}}}]},"Github":{"required":["provider","sparseCheckout"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"},{"type":"object","properties":{"sparseCheckout":{"type":"boolean","description":"Whether the destination is cloned with sparse checkout"},"visibility":{"type":"string","description":"Visibility of the created repository","enum":["PUBLIC","PRIVATE"]}}}]},"Gitlab":{"required":["provider"],"type":"object","allOf":[{"$ref":"#/components/schemas/ScaffolderPublisherOptions"},{"type":"object","properties":{"visibility":{"type":"string","description":"Visibility of the created repository","enum":["PUBLIC","PRIVATE"]}}}]},"ScaffolderResponse":{"required":["createYamlFile","createdAt","id","labels","name","repoLocator","requireNewService","requirePullRequest","showReadme","strictAliasUsage","tag","type","updatedAt"],"type":"object","properties":{"createYamlFile":{"type":"boolean","description":"Whether a cortex.yaml is generated for the created entity"},"createdAt":{"type":"string","description":"ISO-8601 timestamp at which the template was registered"},"description":{"type":"string","description":"Description of the Scaffolder template"},"id":{"type":"string","description":"Unique, auto-generated Cortex ID of the Scaffolder template"},"labels":{"type":"array","description":"Descriptive labels used to group templates in the UI","items":{"type":"string","description":"Descriptive labels used to group templates in the UI"}},"name":{"type":"string","description":"Display name of the Scaffolder template"},"publisherOptions":{"oneOf":[{"$ref":"#/components/schemas/AzureDevops"},{"$ref":"#/components/schemas/Bitbucket"},{"$ref":"#/components/schemas/Github"},{"$ref":"#/components/schemas/Gitlab"}]},"repoLocator":{"oneOf":[{"$ref":"#/components/schemas/AzureDevops"},{"$ref":"#/components/schemas/Bitbucket"},{"$ref":"#/components/schemas/Github"},{"$ref":"#/components/schemas/Gitlab"}]},"requireNewService":{"type":"boolean","description":"Whether running the template must create a new entity"},"requirePullRequest":{"type":"boolean","description":"Whether the template publishes via a pull request to an existing repository"},"showReadme":{"type":"boolean","description":"Whether the template repository's README is shown before a run"},"strictAliasUsage":{"type":"boolean","description":"Whether runs are restricted to the git configuration alias the template names"},"tag":{"type":"string","description":"Stable, human-readable identifier, unique within the workspace"},"type":{"type":"string","description":"The templating engine of the template","enum":["COOKIECUTTER"]},"updatedAt":{"type":"string","description":"ISO-8601 timestamp at which the template was last updated"}}},"ErrorResponse":{"required":["message","type"],"type":"object","properties":{"details":{"type":"string"},"errorCode":{"type":"string"},"gatewayHttpStatus":{"type":"integer","format":"int32"},"httpStatus":{"type":"integer","format":"int32"},"message":{"type":"string"},"requestId":{"type":"string"},"type":{"type":"string","enum":["INTEGRATION_MISSING","INTEGRATION_UNREGISTERED","INTEGRATION_UNSUPPORTED","INTEGRATION_GRAPHQL_ERROR","INTEGRATION_BAD_REQUEST","INTEGRATION_UNAUTHORIZED","INTEGRATION_FORBIDDEN","INTEGRATION_NOT_FOUND","INTEGRATION_UNPROCESSABLE_CONTENT","INTEGRATION_RATE_LIMITED","INTEGRATION_INTERNAL_ERROR","INTEGRATION_NOT_IMPLEMENTED","INTEGRATION_BAD_GATEWAY","INTEGRATION_UNAVAILABLE","INTEGRATION_GATEWAY_TIMEOUT","INTEGRATION_TIMED_OUT","INTEGRATION_CACHE_ERROR","INTEGRATION_UNHANDLED_HTTP_ERROR","INTEGRATION_UNHANDLED_EXCEPTION","INTEGRATION_UNEXPECTED_ERROR","ILLEGAL_ARGUMENT_ERROR","BAD_REQUEST","FORBIDDEN","NOT_FOUND","REQUEST_TIMEOUT","CONFLICT","UNHANDLED_EXCEPTION","UNCATEGORIZED","SERVICE_CREATOR","UNKNOWN_HOST","TOO_MANY_REQUESTS"]}}},"TooManyRequestsProblemDetail":{"required":["type","title","status"],"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string","format":"uri-reference"},"retryAfter":{"minimum":0,"type":"integer","description":"The number of seconds until the rate limiting resets.","format":"int32"},"status":{"maximum":599,"minimum":100,"type":"integer","format":"int32","enum":[429]},"title":{"type":"string"},"type":{"type":"string","format":"uri-reference"}}}},"responses":{"TooManyRequests":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/TooManyRequestsProblemDetail"}}},"description":"The client has exceeded the rate limit by performing too many requests in a short period. Retry the request after a delay.","headers":{"Retry-After":{"description":"The number of seconds until the rate limiting resets.","schema":{"minimum":0,"type":"integer","format":"int32"}}}}}},"paths":{"/api/v1/scaffolders/{tagOrId}":{"put":{"description":"Update a Scaffolder template by tag or Cortex ID.\n\nAPI key must have the `Configure Scaffolder` permission.","operationId":"updateScaffolder","parameters":[{"description":"The tag or unique, auto-generated Cortex ID of the Scaffolder template.","in":"path","name":"tagOrId","required":true,"schema":{"type":"string","description":"Entity identifier - can be a tag or CID"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaffolderRequest"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/ScaffolderRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaffolderResponse"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/ScaffolderResponse"}}},"description":"Scaffolder template updated successfully"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Access denied"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Scaffolder template not found"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"summary":"Update Scaffolder template","tags":["Scaffolder"]}}}}
```

## Delete Scaffolder template

> Delete a Scaffolder template by tag or Cortex ID.\
> \
> API key must have the \`Configure Scaffolder\` permission.

```json
{"openapi":"3.0.1","info":{"title":"Cortex API","version":"v1"},"tags":[{"name":"Scaffolder"}],"servers":[{"url":"https://api.getcortexapp.com","description":"Cortex Cloud API host"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","description":"All requests to the Cortex API need to provide an `Authorization: Bearer <token>` header, where `<token>` is an API key created in the Settings page of your workspace.","scheme":"bearer","type":"http"}},"schemas":{"ErrorResponse":{"required":["message","type"],"type":"object","properties":{"details":{"type":"string"},"errorCode":{"type":"string"},"gatewayHttpStatus":{"type":"integer","format":"int32"},"httpStatus":{"type":"integer","format":"int32"},"message":{"type":"string"},"requestId":{"type":"string"},"type":{"type":"string","enum":["INTEGRATION_MISSING","INTEGRATION_UNREGISTERED","INTEGRATION_UNSUPPORTED","INTEGRATION_GRAPHQL_ERROR","INTEGRATION_BAD_REQUEST","INTEGRATION_UNAUTHORIZED","INTEGRATION_FORBIDDEN","INTEGRATION_NOT_FOUND","INTEGRATION_UNPROCESSABLE_CONTENT","INTEGRATION_RATE_LIMITED","INTEGRATION_INTERNAL_ERROR","INTEGRATION_NOT_IMPLEMENTED","INTEGRATION_BAD_GATEWAY","INTEGRATION_UNAVAILABLE","INTEGRATION_GATEWAY_TIMEOUT","INTEGRATION_TIMED_OUT","INTEGRATION_CACHE_ERROR","INTEGRATION_UNHANDLED_HTTP_ERROR","INTEGRATION_UNHANDLED_EXCEPTION","INTEGRATION_UNEXPECTED_ERROR","ILLEGAL_ARGUMENT_ERROR","BAD_REQUEST","FORBIDDEN","NOT_FOUND","REQUEST_TIMEOUT","CONFLICT","UNHANDLED_EXCEPTION","UNCATEGORIZED","SERVICE_CREATOR","UNKNOWN_HOST","TOO_MANY_REQUESTS"]}}},"TooManyRequestsProblemDetail":{"required":["type","title","status"],"type":"object","properties":{"detail":{"type":"string"},"instance":{"type":"string","format":"uri-reference"},"retryAfter":{"minimum":0,"type":"integer","description":"The number of seconds until the rate limiting resets.","format":"int32"},"status":{"maximum":599,"minimum":100,"type":"integer","format":"int32","enum":[429]},"title":{"type":"string"},"type":{"type":"string","format":"uri-reference"}}}},"responses":{"TooManyRequests":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/TooManyRequestsProblemDetail"}}},"description":"The client has exceeded the rate limit by performing too many requests in a short period. Retry the request after a delay.","headers":{"Retry-After":{"description":"The number of seconds until the rate limiting resets.","schema":{"minimum":0,"type":"integer","format":"int32"}}}}}},"paths":{"/api/v1/scaffolders/{tagOrId}":{"delete":{"description":"Delete a Scaffolder template by tag or Cortex ID.\n\nAPI key must have the `Configure Scaffolder` permission.","operationId":"deleteScaffolder","parameters":[{"description":"The tag or unique, auto-generated Cortex ID of the Scaffolder template.","in":"path","name":"tagOrId","required":true,"schema":{"type":"string","description":"Entity identifier - can be a tag or CID"}}],"responses":{"204":{"description":"Scaffolder template deleted successfully"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Access denied"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Scaffolder template not found"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"summary":"Delete Scaffolder template","tags":["Scaffolder"]}}}}
```
