# cancelBooking

Source: <https://telegafirst.com/docs/api-op-cancelbooking>
Locale: ru
releaseGitSha: ea133cd4ad87fe549ef000b139be145be9bd1717
sourceContentDigest: 62b87425d5edc2edd57d576b08069199884916a598f00d0c604650083981175e
Version: 2

# cancelBooking

`POST /api/v1/booking/bookings/{seqNum}/cancel`

cancelBooking

## Авторизация и права

Scopes: ALL. Auth alternatives: OR; scopes внутри альтернативы: ALL.

| Поле | Значение |
| - | - |
| security.0.hubApiKey | \[] |
| security.1.hubBearer | \[] |
| securitySchemes.hubApiKey.in | "header" |
| securitySchemes.hubApiKey.name | "X-Api-Key" |
| securitySchemes.hubApiKey.type | "apiKey" |
| securitySchemes.hubBearer.scheme | "bearer" |
| securitySchemes.hubBearer.type | "http" |
| x-required-scopes | \["booking:write"] |

## Параметры запроса

| Поле | Значение |
| - | - |
| 0.description | "Required when the cancel body contains a reason; empty {} and an absent or empty header bypass the global cache." |
| 0.in | "header" |
| 0.name | "Idempotency-Key" |
| 0.required | false |
| 0.schema | [0.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 1.in | "path" |
| 1.name | "seqNum" |
| 1.required | true |
| 1.schema | [1.schema](https://telegafirst.com/docs/schema-1530eae3d9b69eb0d4bf2268a4cc47372fcec06f1cf1736785dd6f16848382fc) |

## Тело запроса

| Поле | Значение |
| - | - |
| content.application/json.schema | [BookingCancelRequest](https://telegafirst.com/docs/schema-9269a41e15d6aa60bb0736d73124073366a3a8311fa2614a6604e1da5e0a42cc) |
| required | true |

## Ответы

| Поле | Значение |
| - | - |
| 201.content.application/json.schema | [Booking](https://telegafirst.com/docs/schema-1b496f710b323fdd0218d263136b8aa6635b8f4d0843d9d7f7bbb851162feada) |
| 201.description | "Cancelled booking" |
| 201.headers.X-Bot-Username.schema | [201.headers.X-Bot-Username.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 201.headers.X-Client-Slug.schema | [201.headers.X-Client-Slug.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 201.headers.X-RateLimit-Limit.schema | [201.headers.X-RateLimit-Limit.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 201.headers.X-RateLimit-Remaining.schema | [201.headers.X-RateLimit-Remaining.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 201.headers.X-RateLimit-Reset.schema | [201.headers.X-RateLimit-Reset.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |

## Ошибки

| Поле | Значение |
| - | - |
| 400.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 400.description | "Actual body/param/query pipe rejects the request, or global Idempotency-Key is absent" |
| 401.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 401.description | "Missing, invalid, expired or revoked authentication" |
| 403.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 403.description | "Required ALL scopes, plan or resource policy refused the caller" |
| 404.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 404.description | "Canonical facade could not resolve a resource, schedule, catalog, booking or user in this tenant" |
| 409.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 409.description | "Control-plane conflict, stale resource/schedule version, invalid schedule cursor or global request already processing" |
| 413.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 413.description | "Per-tool payload size or item count exceeded" |
| 422.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 422.description | "Generic global idempotency receipt was reused with a different request body" |
| 429.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 429.description | "Per-tool rate limit exceeded or unavailable" |
| 429.headers.Retry-After.description | "Resource guard retry delay when supplied by the limiter" |
| 429.headers.Retry-After.schema | [429.headers.Retry-After.schema](https://telegafirst.com/docs/schema-0d3ac1e9e006c0119b57d0512759bd7e261ea0d8cb38951a5183d17cdb4391f0) |
| 500.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 500.description | "Unexpected failure reaches the canonical Problem Details filter" |

## Дополнительные условия

| Поле | Значение |
| - | - |
| operationId | "cancelBooking" |
| tags | \["booking"] |
| x-idempotency | "http-cache" |
| x-pagination | null |
