> ## Documentation Index
> Fetch the complete documentation index at: https://code.dcycle.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Workforce Contract

> Retrieve one workforce contract with its terms, category and contract type

[← Own Workforce API](/api-reference/own-workforce/overview)

Return one contract in full: dates, working-hours ratio, employment category, contract type and, when it has ended, the reason.

## Request

### Headers

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication

  **Example:** `sk_live_1234567890abcdef`
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID

  **Example:** `a8315ef3-dd50-43f8-b7ce-d839e68d51fa`
</ParamField>

### Path Parameters

<ParamField path="contract_id" type="string" required>
  Contract UUID, from [List Workforce Contracts](/api-reference/own-workforce/list-contracts)

  **Example:** `7c9e6679-7425-40de-944b-e07fc1f90ae7`
</ParamField>

## Response

<ResponseField name="id" type="string">
  Contract UUID
</ResponseField>

<ResponseField name="start_date" type="string">
  `YYYY-MM-DD`
</ResponseField>

<ResponseField name="end_date" type="string | null">
  Null means open-ended
</ResponseField>

<ResponseField name="working_hours_ratio" type="number">
  Share of a full-time schedule, between 0 (exclusive) and 1. `1` is full time, `0.5` is half time. This is the value that drives FTE.
</ResponseField>

<ResponseField name="labor_agreement" type="boolean">
  Whether the contract is covered by a collective labour agreement
</ResponseField>

<ResponseField name="employment_category" type="string">
  Free-text job category as uploaded
</ResponseField>

<ResponseField name="own_workforce_contract_type" type="string">
  Contract type name, resolved from the catalogue — e.g. `permanent`
</ResponseField>

<ResponseField name="own_workforce_contract_end_contract_reason" type="string | null">
  Why the contract ended, resolved from the catalogue. Null while it is open.
</ResponseField>

<ResponseField name="location_code" type="string">
  **Country name** of the work location.

  Note the inconsistency with [List Workforce Employees](/api-reference/own-workforce/list), where a field of the same name carries the location *name* rather than its country. Do not join the two on this field.
</ResponseField>

<ResponseField name="contract_annual_working_hours" type="number | null">
  Annual hours set by the labour agreement. Null when it was not provided.
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X GET "https://api.dcycle.io/v1/own_workforce_contracts/7c9e6679-7425-40de-944b-e07fc1f90ae7" \
    -H "x-api-key: ${DCYCLE_API_KEY}" \
    -H "x-organization-id: ${DCYCLE_ORG_ID}"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import os

  import requests

  headers = {
      "x-api-key": os.getenv("DCYCLE_API_KEY"),
      "x-organization-id": os.getenv("DCYCLE_ORG_ID"),
  }

  contract_id = "7c9e6679-7425-40de-944b-e07fc1f90ae7"
  response = requests.get(
      f"https://api.dcycle.io/v1/own_workforce_contracts/{contract_id}",
      headers=headers,
  )

  contract = response.json()
  print(f"{contract['own_workforce_contract_type']} at {contract['working_hours_ratio']} FTE")
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const axios = require('axios');

  const headers = {
    'x-api-key': process.env.DCYCLE_API_KEY,
    'x-organization-id': process.env.DCYCLE_ORG_ID
  };

  const contractId = '7c9e6679-7425-40de-944b-e07fc1f90ae7';

  axios.get(`https://api.dcycle.io/v1/own_workforce_contracts/${contractId}`, { headers })
    .then(({ data }) => {
      console.log(`${data.own_workforce_contract_type} at ${data.working_hours_ratio} FTE`);
    })
    .catch(error => console.error(error));
  ```
</CodeGroup>

### Successful Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "start_date": "2023-06-01",
  "end_date": null,
  "working_hours_ratio": 1.0,
  "labor_agreement": true,
  "employment_category": "Engineer",
  "own_workforce_contract_type": "permanent",
  "own_workforce_contract_end_contract_reason": null,
  "location_code": "Spain",
  "contract_annual_working_hours": 1800.0
}
```

## Common Errors

### 401 Unauthorized

**Cause:** the key is invalid, or it does not belong to the organization in `x-organization-id` — the two are looked up as a pair. A request carrying no credentials at all answers `AUTH_REQUIRED` instead.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": "Invalid API key for organization",
  "code": "INVALID_API_KEY"
}
```

### 403 Forbidden

**Cause:** the key's owner is not an enabled member of the organization in `x-organization-id`.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": "Logged User is not Member of Organization",
  "code": "LOGGED_USER_NOT_MEMBER"
}
```

### 404 Not Found

**Cause:** no contract with that id inside your perimeter. A contract whose employee belongs to another organization answers 404, not 403.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "code": "NOT_FOUND",
  "detail": "OwnWorkforceContractModel with id='550e8400-e29b-41d4-a716-446655440000' not found"
}
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="List contracts" icon="list" href="/api-reference/own-workforce/list-contracts">
    All contracts of an employee
  </Card>

  <Card title="List remunerations" icon="money-bill" href="/api-reference/own-workforce/list-remunerations">
    Salaries attached to this contract
  </Card>
</CardGroup>
