Snippets

Create snippet

Create a new snippet

post/workspaces/{workspace_id}/snippets

Request

  • Base URL: https://app.mammoth.io/api/v2
  • URL: https://app.mammoth.io/api/v2/workspaces/{workspace_id}/snippets
  • Auth: one of:
    • HTTP bearer
    • API key in header X-API-KEY and API key in header X-API-SECRET and API key in header X-WORKSPACE-ID

Path parameters

workspace_idinteger required

Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.

Example:4

Request body

namestring required

Snippet name

codestring required

Snippet source code

languagestring required

Language of the snippet (sql or expression)

descriptionstring nullable

Optional description of the snippet

group_idinteger nullable

Optional parameter group to organize the snippet

scopestring

Scope of the snippet

project_idinteger nullable

Required when scope='project'

Response

Create SnippetResponse

idinteger required

Snippet ID

namestring required

Snippet name

codestring required

Snippet source code

languagestring required

Snippet language

descriptionstring nullable

Snippet description

scopestring required

Scope of the snippet

group_idinteger nullable

Parameter group ID

group_namestring nullable

Name of the parameter group

pipeline_countinteger required

Number of pipelines using this snippet

stale_pipelinesinteger[]

Dataview IDs of stale pipelines using this snippet

referenced_parametersstring[] required

Names of parameters used in the snippet code

created_byinteger required

User ID who created the snippet

created_atstring required

Creation timestamp

updated_byinteger nullable

User ID who last updated the snippet

updated_atstring required

Last update timestamp

Changes

No recorded changes to this operation across all 3 revisions of this API.