Skip to main content
POST
/
workspace
/
{workspace_id}
/
task
Create a new scheduled task using XanoScript
curl --request POST \
  --url https://x8ki-letl-twmt.n7.xano.io/api:meta/workspace/{workspace_id}/task \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: text/x-xanoscript' \
  --data 'task foo {
  stack {
    var $x1 {
      value = $input.score + 1
    }
  }
  schedule {
    events = [{starts_on: 2025-07-25 20:00:12+0000, freq: 900}]
  }
}
'
{
  "id": 1,
  "created_at": "2023-04-19 21:01:32+0000",
  "updated_at": "2023-04-19 21:01:32+0000",
  "name": "Task Test",
  "description": "My tasks description",
  "docs": "Documentation",
  "guid": "YE1fwVhQ-enRlc6Sb42Gqru58-0",
  "datasource": "test",
  "active": true,
  "branch": "v1",
  "tag": [
    "example tag"
  ],
  "xanoscript": {
    "status": "ok",
    "value": "<string>",
    "message": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspace_id
integer
required

Query Parameters

branch
string
default:""

Body

The body is of type string.

Example:

"task foo {\n stack {\n var $x1 {\n value = $input.score + 1\n }\n }\n schedule {\n events = [{starts_on: 2025-07-25 20:00:12+0000, freq: 900}]\n }\n}\n"

Response

Success!

id
integer
default:1
created_at
string<timestamptz>
default:2023-04-19 21:01:32+0000
updated_at
string<timestamptz>
default:2023-04-19 21:01:32+0000
name
string
default:Task Test
description
string
default:My tasks description
docs
string
default:Documentation
guid
string
default:YE1fwVhQ-enRlc6Sb42Gqru58-0
datasource
string
default:test
active
boolean
default:true
branch
string
default:v1
tag
string[]
xanoscript
object
I