---
title: "Issue an impersonation token for a customer"
method: POST
path: "/customers/{customerId}/impersonate"
tags: ["Admin Customers"]
---

# Issue an impersonation token for a customer

`POST /customers/{customerId}/impersonate`

## Request

- Base URL: `http://localhost:8000/api/admin`
- URL: `http://localhost:8000/api/admin/customers/{customerId}/impersonate`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-admin-api/docs/customers/:customerId/impersonate/post.ts> (a function with typed inputs; its response is checked against the schema)

Returns a Sanctum customer token that the admin can use to act as the customer. The token expires in 1 hour and is audited as having been issued by the calling admin. No request body — the customer is identified by the path.

## Path parameters

- `customerId` integer, required

## Response `201`

Impersonation token issued.

## Other responses

- `400`: Invalid input
- `422`: Validation Error

---

[API](https://skmtc.dev/bagisto/apis/bagisto-admin-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-admin-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-admin-api/revisions/3198f11be70f?raw)
