Deel: Request termination
Deel gpHiring.createGpworkerTermination: arguments, response, policy and SDK examples.
← GP hiring operations · Get started
Operation deel.gphiring_creategpworkertermination
Provider route: POST /gp/workers/{worker_id}/terminations. 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["gpHiring"]["createGpworkerTermination"]>[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.gpHiring.createGpworkerTermination(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.gp_hiring.create_gpworker_termination(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.worker_id | string | Required within parent | Format: uuid |
body | object | Optional | |
body.data | Model | Required within parent | Expand Request termination — request body — body data |
Referenced models: Request termination — 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 Request termination — 201 response body |
Referenced models: Request termination — 201 response body
Schemas
Section titled “Schemas”Request termination — request body — body data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
desired_end_date | string | Required within parent | The preferred end date for terminating the worker's engagement, in ISO-8601 format (YYYY-MM-DD). Format: date |
is_voluntary | boolean | Required within parent | Indicates whether the worker termination is voluntary (true) or involuntary (false). |
last_date_of_work | string | Required within parent | The effective termination date of the worker's employment, in ISO-8601 format (YYYY-MM-DD). Format: date |
message | string | Required within parent | The reason for terminating the worker's engagement. |
severance | Model | Required within parent | Expand Request termination — request body — body data severance |
Referenced models: Request termination — request body — body data severance
Request termination — 201 response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | Model | Required within parent | Expand Request termination — 201 response body — data |
Referenced models: Request termination — 201 response body — data
Request termination — request body — body data severance
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (oneOf 1) | Model | Alternative | Expand Request termination — request body — body / data / severance / time_unit: DAYS, WEEKS, MONTHS, type: TIME |
$ (oneOf 2) | Model | Alternative | Expand Request termination — request body — body / data / severance / type: CASH |
Referenced models: Request termination — request body — body / data / severance / time_unit: DAYS, WEEKS, MONTHS, type: TIME, Request termination — request body — body / data / severance / type: CASH
Request termination — 201 response body — data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
id | string | Required within parent | Unique identifier for the termination request. Format: uuid |
last_date_of_work | string | Required within parent | Long date-time format following ISO-8601. Format: date-time |
Request termination — request body — body / data / severance / time_unit: DAYS, WEEKS, MONTHS, type: TIME
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
amount | number | Required within parent | The amount of severance, specified in the designated currency or time unit. Format: double |
currency | string | Required within parent | Currency code for severance. Maximum length: 3 Minimum length: 3 Pattern: ^[A-Z]{3}$ |
time_unit | string | Required within parent | The unit of time for severance (e.g., DAYS, WEEKS, MONTHS). One of: DAYS, WEEKS, MONTHS |
type | string | Required within parent | The type of severance, either in time off. One of: TIME |
Request termination — request body — body / data / severance / type: CASH
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
amount | number | Required within parent | The amount of severance, specified in the designated currency. Format: double |
currency | string | Required within parent | Currency code for severance. Maximum length: 3 Minimum length: 3 Pattern: ^[A-Z]{3}$ |
type | string | Required within parent | The type of severance, in cash. One of: CASH |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: deel.gphiring_creategpworkertermination. Catalog operation: gphiring_creategpworkertermination. 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: ["global-payroll:write"]
Pinned headers: {"X-Version": "2026-01-01"}