---
title: "Create an access code"
method: POST
path: "/v1/location/{location_id}/create_access_code"
tags: ["Access codes"]
---

# Create an access code

`POST /v1/location/{location_id}/create_access_code`

## Path parameters

- `location_id` string, required

## Request body

- CreateAccessCodeRequest
  - `visit_type_slug` string, required
  - `work_order_id` string, nullable — Associate this access code with a work order. The work order must be in `open` status.
  - `metadata` AccessCodeCustomerMetadataExternalSchema
    - `recipient` string, nullable — Who the access code is intended for (e.g. a vendor name or email).
    - `redirect_url` string, nullable — Optional URL that the recipient can open from the NavigateAI mobile app after using the access code (via long-press on the upload entry). Useful for sending the recipient back to a task or page in your own app once they've finished capturing.
  - `visit_metadata` object, nullable
  - `expires_at` string, date-time, nullable — When the access code stops working, as an ISO 8601 UTC timestamp (e.g. `2026-12-31T23:59:59Z`). Must be in the future and timezone-aware. Omit for a code that never expires.

## Response `200`

OK

- CreateAccessCodeResponse
  - `access_code` string, required
  - `deeplink_url` string, required
  - `expires_at` string, date-time, nullable, required

---

[API](https://skmtc.net/navigateai/apis/navigateai-api.md) · [All operations](https://skmtc.net/navigateai/apis/navigateai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/navigateai/navigateai-api/revisions/5fb236d03a88/schema)
