Delete a template
const url = 'https://api.sloose.com/orgs/org_9f3c/templates/b3f1c8a2';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://api.sloose.com/orgs/org_9f3c/templates/b3f1c8a2 \ --header 'Authorization: Bearer <token>'A template shared with the org may be deleted by any builder or above; a private one only by its creator or an admin. Every import started from it or saved as it is detached in the same write — its pointer cleared and its version moved, with the caller recorded as the writer — and keeps its own copy of the recipe. Run history is kept: a run records what happened, not what the template says now. The template’s schedules and versions go with it.
Refused while any of those imports is running (409 IMPORT_RUNNING, naming each import and its run): a running import refuses every write, and the detach is one. Nothing is deleted or detached; try again when the run ends.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The org id the session was issued for. A token for one org can never read another.
Example
org_9f3cThe org id the session was issued for. A token for one org can never read another.
The template id.
Example
b3f1c8a2The template id.
Responses
Section titled “Responses”Deleted.
object
How many imports were detached.
Example
{ "ok": true}No bearer, or one that is expired, revoked or no longer resolves to a member.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}The bearer’s role is too low, or it was issued for a different org.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}No such template, or it is not visible to this session.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}An import started from the template or saved as it is running (code: IMPORT_RUNNING, with running: each { importId, runId }). Nothing was deleted.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}