Deel: Create a new task
Deel tasks.createContractTask: arguments, response, policy and SDK examples.
← Tasks operations · Get started
Operation deel.tasks_createcontracttask
Provider route: POST /contracts/{contract_id}/tasks. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/deel with npm, or alter-sdk-deel with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { DeelIntegration } from "@alter-ai/deel";
async function execute(input: Parameters<DeelIntegration["tasks"]["createContractTask"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new DeelIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.tasks.createContractTask(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_deel import DeelIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = DeelIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.tasks.create_contract_task(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.contract_id | string | Required within parent | |
body | object | Optional | |
body.data | Model | Required within parent | Expand Create a new task — request body — body data |
Referenced models: Create a new task — request body — body data
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Create a new task — 201 response body |
Referenced models: Create a new task — 201 response body
Schemas
Section titled “Schemas”Create a new task — request body — body data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
amount | string | Required within parent | The amount to be associated with the task, in the appropriate currency. |
date_submitted | Model | Required within parent | Expand Create a new task — request body — body data date submitted The date the task was submitted, in ISO 8601 format. Also accepts date-time (YYYY-MM-DDTHH:MM:SSZ). |
description | string or null | Required within parent | A description of the task. |
group_key | string or null | Optional | When provided, tasks sharing the same group_key within the same payment cycle are merged into a single aggregated line item on the invoice. The group_key is used as the invoice line item description. Requires is_auto_approved to be true. Maximum length: 300 |
hourly_report_preset_id | string or null | Optional | Id of an existing TRACKING preset. Format: uuid |
is_auto_approved | boolean | Optional | If true, the task will be automatically approved as part of the request. Required to be true when group_key is provided. |
Referenced models: Create a new task — request body — body data date submitted
Create a new task — 201 response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | Model | Required within parent | Expand Create a new task — 201 response body — data |
Referenced models: Create a new task — 201 response body — data
Create a new task — request body — body data date submitted
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | The date the task was submitted, in ISO 8601 format. Also accepts date-time (YYYY-MM-DDTHH:MM:SSZ). |
$ (oneOf 1) | string | Alternative | Format: date |
$ (oneOf 2) | string | Alternative | Format: date-time |
Create a new task — 201 response body — data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
created | boolean | Optional | Indicates whether the task creation operation was successful. |
id | string | Optional | The unique identifier for the created task. Format: uuid |
status | JSON | Optional | The current status of the task. |
status (anyOf 1) | string | Alternative | The current status of the task. Known values: approved, declined, new, not_payable, paid, pending, processing |
status (anyOf 2) | null | Alternative |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: deel.tasks_createcontracttask. Catalog operation: tasks_createcontracttask. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["contracts:write"]
Pinned headers: {"X-Version": "2026-01-01"}