# Retrieve onboarding right-to-work case for a worker

GET https://api.letsdeel.com/rest/v2/immigration/workers/{worker_id}/onboarding-case

Returns the right to work case for employee onboarding including the documents if any. In case no right to work case is open, the response will be empty.
 **Token scopes**: `worker:read`

Reference: https://developer.deel.com/api/endpoints/immigration/get-worker-onboarding-case

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Deel HRIS SCIM API
  version: 1.0.0
paths:
  /immigration/workers/{worker_id}/onboarding-case:
    get:
      operationId: get-worker-onboarding-case
      summary: Retrieve onboarding right-to-work case for a worker
      description: >-
        Returns the right to work case for employee onboarding including the
        documents if any. In case no right to work case is open, the response
        will be empty.
         **Token scopes**: `worker:read`
      tags:
        - subpackage_immigration
      parameters:
        - name: worker_id
          in: path
          description: The hris profile oid (public id) of the worker.
          required: true
          schema:
            type: string
        - name: contract_id
          in: query
          description: >-
            Filters the worker's onboarding case to a specific contract. If the
            worker has multiple contracts and this parameter is omitted, the
            response may return a case from any associated contract; the
            response includes contract.id to indicate which contract was used.
            Provide this parameter for deterministic results.
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: >
            ## Authentication

            The Deel API uses bearer tokens to authenticate requests. All API
            calls must be made over HTTPS — calls over plain HTTP or without
            authentication will fail.


            ```curl

            curl -X GET 'https://api.letsdeel.com/rest/v2/contracts' \
              -H 'Authorization: Bearer YOUR-TOKEN-HERE'
            ```


            [Learn more about authentication](/api/authentication)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/immigration_getWorkerOnboardingCase_Response_200
        '400':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/RetrieveOnboardingRightToWorkCaseForAWorkerRequestBadRequestError
        '401':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
        '403':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
        '404':
          description: Case not found.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/RetrieveOnboardingRightToWorkCaseForAWorkerRequestNotFoundError
        '500':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/RetrieveOnboardingRightToWorkCaseForAWorkerRequestInternalServerError
servers:
  - url: https://api.letsdeel.com/rest/v2
  - url: https://api-staging.letsdeel.com/rest/v2
components:
  schemas:
    ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataStatus:
      type: string
      enum:
        - OPEN
        - CLOSED
        - ON_HOLD
      description: Status of the immigration case.
      title: >-
        ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataStatus
    ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataProcessName:
      type: string
      enum:
        - WORK_AUTHORIZATION_VERIFICATION
      description: Name of the current active process.
      title: >-
        ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataProcessName
    ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataProcessStatus:
      type: string
      enum:
        - CANCELLED
        - AWAITING_DOCUMENTS
        - IN_REVIEW
        - APPROVED
        - REJECTED
      description: Status of the current active process.
      title: >-
        ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataProcessStatus
    ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataProcess:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the current active process.
        name:
          $ref: >-
            #/components/schemas/ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataProcessName
          description: Name of the current active process.
        status:
          $ref: >-
            #/components/schemas/ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataProcessStatus
          description: Status of the current active process.
        rejection_note:
          type: string
          description: >-
            A detailed description of why the case was rejected. Only available
            if the case status is REJECTED.
        rejection_reason:
          type: string
          description: >-
            The reason why the case was rejected. Only available if the case
            status is REJECTED.
      description: The current active process
      title: >-
        ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataProcess
    ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataContract:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: Id of the contract associated with the immigration case
      description: The contract associated with the returned immigration case
      title: >-
        ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataContract
    ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataApplicant:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the applicant profile id.
        external_id:
          type:
            - string
            - 'null'
          description: >-
            External identifier of the applicant  (from partner system or third
            party).
      description: The employee for which this Right to Work case has been created for
      title: >-
        ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataApplicant
    ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataCaseType:
      type: string
      enum:
        - IMMIGRATION_DOCUMENT_REVIEW
      description: ' Type of the case. It will always be IMMIGRATION_DOCUMENT_REVIEW for this endpoint.'
      title: >-
        ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataCaseType
    ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataDocumentsItemsStatus:
      type: string
      enum:
        - IN_REVIEW
        - ACTIVE
        - EXPIRED
        - EXPIRING
      description: Status of the document.
      title: >-
        ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataDocumentsItemsStatus
    ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataDocumentsItems:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the document.
        status:
          $ref: >-
            #/components/schemas/ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataDocumentsItemsStatus
          description: Status of the document.
        document_type:
          type:
            - string
            - 'null'
          description: >-
            The type of the document. Represents the visa type for right to work
            cases.
        expiration_date:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Expiry date of the document. If document does not expire, it will be
            null
      title: >-
        ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataDocumentsItems
    ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of immigration case.
        status:
          $ref: >-
            #/components/schemas/ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataStatus
          description: Status of the immigration case.
        process:
          $ref: >-
            #/components/schemas/ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataProcess
          description: The current active process
        contract:
          $ref: >-
            #/components/schemas/ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataContract
          description: The contract associated with the returned immigration case
        applicant:
          oneOf:
            - $ref: >-
                #/components/schemas/ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataApplicant
            - type: 'null'
          description: The employee for which this Right to Work case has been created for
        case_type:
          $ref: >-
            #/components/schemas/ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataCaseType
          description: ' Type of the case. It will always be IMMIGRATION_DOCUMENT_REVIEW for this endpoint.'
        documents:
          type: array
          items:
            $ref: >-
              #/components/schemas/ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaDataDocumentsItems
          description: A list of documents associated to the immigration case
        visa_type:
          type:
            - string
            - 'null'
          description: The type of the visa.
        created_at:
          type: string
          format: date-time
          description: Creation date of the immigration case.
        updated_at:
          type: string
          format: date-time
          description: Last activity on the immigration case.
        country_code:
          type: string
          description: The country of the immigration case.
        estimated_completion_date:
          type:
            - string
            - 'null'
          format: date-time
          description: Estimated completion date of the immigration case.
      title: >-
        ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaData
    immigration_getWorkerOnboardingCase_Response_200:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaData
      title: immigration_getWorkerOnboardingCase_Response_200
    ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaErrorsItems:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
        message:
          type: string
          description: Human-readable explanation of the error
      title: >-
        ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaErrorsItems
    RetrieveOnboardingRightToWorkCaseForAWorkerRequestBadRequestError:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: >-
              #/components/schemas/ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaErrorsItems
      title: RetrieveOnboardingRightToWorkCaseForAWorkerRequestBadRequestError
    ApiErrorRequest:
      type: object
      properties:
        method:
          type: string
          description: The HTTP method of the failed request
        url:
          type: string
          description: The relative URL of the failed request
        status:
          type: number
          format: double
          description: The status code of the response
        api_req_id:
          type: string
          description: The request ID of the failed request
        docs:
          type: string
          description: >-
            A link to the official documentation for the requested endpoint
            resource
        source:
          type: string
          description: The source handler which produced the returned error
        code:
          type: number
          format: double
          description: The code of the source handler which produced the returned error
      title: ApiErrorRequest
    ApiError:
      type: object
      properties:
        message:
          type: string
          description: A description of the returned error
        path:
          type: string
          description: The JSON path where input validation failed
      title: ApiError
    ApiErrorContainer:
      type: object
      properties:
        request:
          $ref: '#/components/schemas/ApiErrorRequest'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiError'
      title: ApiErrorContainer
    RetrieveOnboardingRightToWorkCaseForAWorkerRequestNotFoundError:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: >-
              #/components/schemas/ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaErrorsItems
      required:
        - errors
      title: RetrieveOnboardingRightToWorkCaseForAWorkerRequestNotFoundError
    RetrieveOnboardingRightToWorkCaseForAWorkerRequestInternalServerError:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: >-
              #/components/schemas/ImmigrationWorkersWorkerIdOnboardingCaseGetResponsesContentApplicationJsonSchemaErrorsItems
      title: RetrieveOnboardingRightToWorkCaseForAWorkerRequestInternalServerError
  securitySchemes:
    deelToken:
      type: http
      scheme: bearer
      description: >
        ## Authentication

        The Deel API uses bearer tokens to authenticate requests. All API calls
        must be made over HTTPS — calls over plain HTTP or without
        authentication will fail.


        ```curl

        curl -X GET 'https://api.letsdeel.com/rest/v2/contracts' \
          -H 'Authorization: Bearer YOUR-TOKEN-HERE'
        ```


        [Learn more about authentication](/api/authentication)
    oauth2:
      type: http
      scheme: bearer
      description: >-
        Standard OAuth2 security scheme based on
        https://swagger.io/docs/specification/authentication/

```

## SDK Code Examples

```python
import requests

url = "https://api.letsdeel.com/rest/v2/immigration/workers/a6fb5c89-5abd-45d1-afc1-7e98d550eb71/onboarding-case"

querystring = {"contract_id":"359pr8y"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.letsdeel.com/rest/v2/immigration/workers/a6fb5c89-5abd-45d1-afc1-7e98d550eb71/onboarding-case?contract_id=359pr8y';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.letsdeel.com/rest/v2/immigration/workers/a6fb5c89-5abd-45d1-afc1-7e98d550eb71/onboarding-case?contract_id=359pr8y"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.letsdeel.com/rest/v2/immigration/workers/a6fb5c89-5abd-45d1-afc1-7e98d550eb71/onboarding-case?contract_id=359pr8y")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.letsdeel.com/rest/v2/immigration/workers/a6fb5c89-5abd-45d1-afc1-7e98d550eb71/onboarding-case?contract_id=359pr8y")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.letsdeel.com/rest/v2/immigration/workers/a6fb5c89-5abd-45d1-afc1-7e98d550eb71/onboarding-case?contract_id=359pr8y', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/v2/immigration/workers/a6fb5c89-5abd-45d1-afc1-7e98d550eb71/onboarding-case?contract_id=359pr8y");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.letsdeel.com/rest/v2/immigration/workers/a6fb5c89-5abd-45d1-afc1-7e98d550eb71/onboarding-case?contract_id=359pr8y")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```