---
title: "Add external Id"
method: PATCH
path: "/contracts/{contract_id}"
tags: ["contracts"]
---

# Add external Id

`PATCH /contracts/{contract_id}`

## Request

- Base URL: `https://api.letsdeel.com/rest`
- URL: `https://api.letsdeel.com/rest/contracts/{contract_id}`
- Auth: HTTP bearer

Sets an external identifier. Link your internal reference IDs, such as employee numbers or ERP keys, to a Deel worker. The external ID must be unique and, once set, can be used as a filter when listing contracts to directly look up Deel records from an external system.

 **Token scopes**: `contracts:write`

## Path parameters

- `contract_id` string, required

## Request body

- object
  - `data` ContractsContractIdPatchRequestBodyContentApplicationJsonSchemaData, required
    - `external_id` string, nullable, required: A unique identifier for the object provided by an external system. Use or send null when you want to reset the external id.

## Response `200`

Successful operation.

- ContractsUpdateICContractResponse200
  - `id` string, required: Unique identifier for the contract.
  - `type` 'ongoing_time_based' | 'milestones' | 'time_based' | 'pay_as_you_go_time_based' | 'commission' | 'payg_milestones' | 'payg_tasks' | 'contractor_outside_deel' | 'eor' | 'unknown' | 'employee' | 'global_payroll' | 'shield_msa' | 'hris_direct_employee' | 'peo', required: Type of a contract.
  - `quote` ContractsContractIdPatchResponsesContentApplicationJsonSchemaQuote: EOR quote approved by Deel.
    - `benefits` ContractsContractIdPatchResponsesContentApplicationJsonSchemaQuoteBenefitsItems[]: Array of benefits.
      - `fee` number, double: Fee in local currency.
      - `name` string: Benefit's name.
      - `plan` string: Benefit's plan.
      - `price` number, double: Price in local currency.
      - `fee_usd` number, double: Fee in USD.
      - `currency` string: Currency code.
      - `price_usd` number, double: Price in USD.
    - `currency` string: Currency used for the quote.
  - `title` string, required: Title of the contract.
  - `client` ContractsContractIdPatchResponsesContentApplicationJsonSchemaClient, nullable, required: Client details associated with the contract.
    - `id` string: Unique identifier of this resource.
    - `team` ContractsContractIdPatchResponsesContentApplicationJsonSchemaClientTeam, required: Team information for the client organization.
      - `id` union, required: Unique identifier of this resource.
        - string
        - number, double
      - `name` string, required: Name of a team.
    - `email` string, nullable: User's email address. It can be an empty string when no email has been provided for the worker. This can happen for draft contracts or workers with incomplete onboarding.
    - `full_name` string: Full name of the client.
    - `legal_entity` ContractsContractIdPatchResponsesContentApplicationJsonSchemaClientLegalEntity, nullable: Legal entity details of the client.
      - `id` string: Unique identifier of this resource.
      - `name` string: Name of a team.
      - `type` string, nullable: Type of the legal entity.
      - `email` string, nullable: Email address of the legal entity.
      - `subtype` string, nullable: Sub-type of the legal entity.
      - `vat_number` string, nullable: VAT number of the legal entity.
      - `registration_number` string, nullable: Registration number of the legal entity.
  - `status` 'new' | 'under_review' | 'waiting_for_employee_contract' | 'waiting_for_client_sign' | 'processing_payment' | 'waiting_for_contractor_sign' | 'waiting_for_eor_sign' | 'waiting_for_employee_sign' | 'awaiting_deposit_payment' | 'in_progress' | 'completed' | 'cancelled' | 'user_cancelled' | 'rejected' | 'waiting_for_client_payment' | 'onboarding' | 'waiting_for_approval' | 'onboarded', required: Status of a contract in Deel workflow.
  - `worker` ContractsContractIdPatchResponsesContentApplicationJsonSchemaWorker, nullable, required: Worker details associated with the contract.
    - `id` string: Unique identifier of this resource.
    - `email` string, email, nullable: User's email address.
    - `country` string, nullable: Country of the worker.
    - `full_name` string: Full name of the client.
    - `last_name` string: Last name of the worker.
    - `first_name` string: First name of the worker.
    - `nationality` string, nullable: Nationality of the worker.
    - `date_of_birth` union: Date of birth of the worker. Supports full date-time, date-only, or an empty string.
      - string, date-time
      - string, date
      - '': Empty string for unknown/unset values.
    - `expected_email` string: Expected email address of the worker (e.g., invitation target email).
    - `alternate_email` ContractsContractIdPatchResponsesContentApplicationJsonSchemaWorkerAlternateEmailItems[], nullable: List of alternate email addresses.
      - `email` string: Email address of the worker.
      - `isVerified` boolean: Indicates whether this alternate email address has been verified.
  - `job_title` string: Job title associated with the contract.
  - `seniority` ContractsContractIdPatchResponsesContentApplicationJsonSchemaSeniority, nullable: Seniority describes level of expertise at a job e.g. junior.
    - `id` number, double, nullable: Unique identifier of this resource.
    - `name` string, nullable: Name of seniority level e.g. Mid (Individual Contributor Level 2).
    - `level` number, double, nullable: Level of seniority level e.g. 2.
  - `created_at` string, date-time, required: Date and time when the contract was created.
  - `signatures` ContractsContractIdPatchResponsesContentApplicationJsonSchemaSignatures, required: Signature information for the contract parties.
    - `signed_at` string, date-time, nullable: Date and time when the contract was signed.
    - `client_signature` string: Client representative signature (typically a name).
    - `client_signed_at` string, date-time, nullable: Date and time when the client signed the contract.
    - `worker_signature` string: Worker signature (typically a name).
    - `worker_signed_at` string, date-time, nullable: Date and time when the worker signed the contract.
  - `start_date` string, date-time, required: Date and time when the contract starts.
  - `updated_at` string, date-time, required: Date and time when the contract was updated.
  - `external_id` string, nullable: External identifier of the contract.
  - `invitations` ContractsContractIdPatchResponsesContentApplicationJsonSchemaInvitations, required: Invitation email addresses for signing the contract.
    - `client_email` string, nullable: User's email address.
    - `worker_email` string, nullable: User's email address.
  - `is_archived` boolean, nullable, required: Flag to indicate if the contract is archived.
  - `who_reports` string: Who reports the hours.
  - `cost_centers` ContractsContractIdPatchResponsesContentApplicationJsonSchemaCostCentersItems[]: List of cost centers associated with the contract.
    - `name` string: Cost center name.
    - `number` string: Cost center number.
    - `allocation_percentage` number, double: Percentage of the cost center allocation.
  - `custom_fields` ContractsContractIdPatchResponsesContentApplicationJsonSchemaCustomFieldsItems[], nullable: List of custom fields attached to the contract.
    - `name` string: Custom field property name.
    - `value` string: Custom field property value.
  - `notice_period` number, double, nullable: Notice period in days.
  - `scope_of_work` string, nullable: Scope of work of the contract.
  - `work_schedule` ContractsContractIdPatchResponsesContentApplicationJsonSchemaWorkSchedule, nullable: Defines a work schedule including working days, hours, and employment details
    - `days` ContractsContractIdPatchResponsesContentApplicationJsonSchemaWorkScheduleDaysItems[], required: Working days and hours configuration
      - `day` 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY', required: Day of the week
      - `end` string, nullable, required: End time for the work day (HH:MM:SS format, local time without offset)
      - `start` string, required: Start time for the work day (HH:MM:SS format, local time without offset)
      - `work_hours` string, required: Number of working hours for this day
    - `name` string, required: Unique identifier or name for the work schedule
    - `country` string, required: Country code where this work schedule applies (ISO 3166-1 alpha-2)
    - `worker_types` ContractsContractIdPatchResponsesContentApplicationJsonSchemaWorkScheduleWorkerTypesItems[], required: List of worker types that can use this schedule
    - `employment_type` 'FULL_TIME' | 'PART_TIME' | 'CONTRACT' | 'TEMPORARY', nullable: Type of employment arrangement
    - `work_schedule_type` string, required: Work schedule type
    - `work_hours_per_week` integer, required: Total number of working hours per week
  - `special_clause` string, nullable, required: Special clause of the contract.
  - `employment_type` 'FULL_TIME' | 'PART_TIME', nullable: Type of employment.
  - `termination_date` string, nullable, required: Date and time when the contract ends.
  - `contract_template` ContractsContractIdPatchResponsesContentApplicationJsonSchemaContractTemplate, nullable: Contract template details.
    - `id` string: Unique identifier of a contract template.
    - `title` string: Title of a contract template
  - `work_statement_id` string, nullable: The unique identifier of the associated work statement.
  - `employment_details` ContractsContractIdPatchResponsesContentApplicationJsonSchemaEmploymentDetails: Employment-related details for the contract.
    - `type` string: Type of employment.
    - `days_per_week` number, double: Number of days per week.
    - `hours_per_day` number, double: Number of hours per day.
    - `probation_period` number, double, nullable: Probation period in days.
    - `paid_vacation_days` number, double: Number of paid vacation days.
  - `compensation_details` ContractsContractIdPatchResponsesContentApplicationJsonSchemaCompensationDetails: Compensation and payment configuration for the contract.
    - `scale` string, nullable: Scale of the payment.
    - `amount` string, nullable: Amount to be paid. This field can be excluded when creating a Pay-as-you-go task-based or Milestone contracts.
    - `cycle_end` number, double, nullable: Day of the cycle end
    - `frequency` string: Scale of the invoice cycle.
    - `currency_code` string, nullable: Currency code.
    - `first_payment` string, nullable: First payment amount.
    - `cycle_end_type` 'DAY_OF_WEEK' | 'DAY_OF_LAST_WEEK' | 'DAY_OF_MONTH', nullable: Cycle end type
    - `first_payment_date` string, nullable: First payment date.
    - `gross_annual_salary` string, nullable: Gross annual salary.
    - `gross_signing_bonus` string, nullable: Gross signing bonus.
    - `gross_variable_bonus` string, nullable: Gross variable bonus.

## Other responses

- `400`: Operation failed.
- `401`: Operation failed.
- `403`: Operation failed.
- `404`: Not found
- `500`: Operation failed.

## Changes

- **2026-10-30** `d7657cb104bd`: 2 breaking
  - the `work_schedule/oneOf[subschema #1: ContractsContractIdPatchResponsesContentApplicationJsonSchemaWorkSchedule]/days/items/end` response's property format changed from `time` to no format for status `200`
  - the `work_schedule/oneOf[subschema #1: ContractsContractIdPatchResponsesContentApplicationJsonSchemaWorkSchedule]/days/items/start` response's property format changed from `time` to no format for status `200`

[Operation history](https://skmtc.dev/deel/apis/endpoints-2/changes/contracts/:contract_id/patch.md)

---

[API](https://skmtc.dev/deel/apis/endpoints-2.md) - [All operations](https://skmtc.dev/deel/apis/endpoints-2/llms.txt) - [OpenAPI document](https://skmtc.dev/deel/apis/endpoints-2/revisions/b48979ae8a04?raw)
