> For the complete documentation index, see [llms.txt](https://docs.channex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.channex.io/channel-api-examples/airbnb.md).

# Airbnb

This guide walks through connecting Airbnb to Channex over the API: generating the OAuth connection link, handling the redirect, discovering the listings, mapping them to rate plans, activating the connection, and managing the listings afterwards.

Airbnb is the exception among channels. Where other OTAs are connected by creating a channel with credentials (`POST /api/v1/channels`), an Airbnb connection is established through **OAuth**: you generate a connection link, the property owner opens it, signs in to Airbnb and authorizes Channex — and the channel connection is created automatically. Mappings are also different: instead of the `rate_plans` array of the connection payload, Airbnb listings are mapped **one by one** through dedicated mapping endpoints.

API requests are authenticated with an API key sent in the `user-api-key` header.

### The flow at a glance

1. Generate a connection link and hand it to the property owner.
2. The owner authorizes Channex on Airbnb; the connection is created automatically — inactive.
3. Handle the redirect and read the connection.
4. List the Airbnb listings of the connected account.
5. Map each listing to a rate plan.
6. Activate the connection.
7. Load the existing reservations.

After that, the connection is live: Channex pushes availability, rates and restrictions to Airbnb and receives bookings back. The listings themselves — their pricing, availability rules, booking settings, publication state, promotions and more — are managed through the connection, covered in the second half of this guide.

### 1. Generate the connection link

## Generate a connection link

> Generate an Airbnb connection link. Airbnb connections are established\
> through OAuth: the link is opened by the property owner, who signs in to\
> Airbnb and authorizes Channex, and a channel connection is created\
> automatically — inactive, ready to be mapped and activated. The link\
> supports third-party redirects, so the flow can be embedded in an\
> external application without sending the user to the Channex interface.\
> \
> After the authorization completes, the user is redirected to\
> \`redirect\_uri\` with \`?success=true\&channel\_id={channel\_id}\&token={token}\`\
> appended — the ID of the created (or re-connected) channel connection and\
> the \`token\` submitted here. On failure the user is redirected to\
> \`failure\_redirect\_uri\` with \`?success=false\`. The link is valid for two\
> hours.\
> \
> An Airbnb account holds one connection: re-connecting an existing\
> connection is done by passing its \`channel\_id\`.

```json
{"openapi":"3.1.0","info":{"title":"Channex.io — Channels","version":"0.0.0"},"tags":[{"name":"Airbnb","description":"Airbnb-specific operations of channel connections: authorization, the listing settings stored on the rate plan mappings (pricing, availability, and booking settings), and listing promotions."}],"servers":[{"url":"https://app.channex.io/api/v1","description":"Production server","variables":{}},{"url":"https://staging.channex.io/api/v1","description":"Staging server","variables":{}}],"security":[{}],"paths":{"/meta/airbnb/connection_link":{"post":{"operationId":"Meta_createAirbnbConnectionLink","summary":"Generate a connection link","description":"Generate an Airbnb connection link. Airbnb connections are established\nthrough OAuth: the link is opened by the property owner, who signs in to\nAirbnb and authorizes Channex, and a channel connection is created\nautomatically — inactive, ready to be mapped and activated. The link\nsupports third-party redirects, so the flow can be embedded in an\nexternal application without sending the user to the Channex interface.\n\nAfter the authorization completes, the user is redirected to\n`redirect_uri` with `?success=true&channel_id={channel_id}&token={token}`\nappended — the ID of the created (or re-connected) channel connection and\nthe `token` submitted here. On failure the user is redirected to\n`failure_redirect_uri` with `?success=false`. The link is valid for two\nhours.\n\nAn Airbnb account holds one connection: re-connecting an existing\nconnection is done by passing its `channel_id`.","parameters":[],"responses":{"200":{"description":"The request has succeeded.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Meta.AirbnbConnectionLinkResource"}},"description":"JSON:API document wrapping a single resource."}}}},"422":{"description":"The request has missing or invalid arguments; `details` lists the messages per argument.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.InvalidArguments"}}}},"503":{"description":"The request to the channel took too long and was aborted; retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Meta.MetaActionTimeout"}}}}},"tags":["Airbnb"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Meta.AirbnbConnectionLinkRequest"}}}}}}},"components":{"schemas":{"Meta.AirbnbConnectionLinkResource":{"type":"object","required":["type","attributes"],"properties":{"type":{"type":"string","enum":["connection_link"]},"attributes":{"$ref":"#/components/schemas/Meta.AirbnbConnectionLink"}},"description":"A generated Airbnb connection link."},"Meta.AirbnbConnectionLink":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"The Airbnb authorization URL to hand to the property owner. Valid for two hours."}},"description":"Attributes of a generated connection link."},"Common.Errors.InvalidArguments":{"type":"object","required":["errors"],"properties":{"errors":{"$ref":"#/components/schemas/Common.Errors.InvalidArgumentsObject"}},"description":"The request has missing or invalid arguments; `details` lists the messages per argument."},"Common.Errors.InvalidArgumentsObject":{"type":"object","required":["code","title","details"],"properties":{"code":{"type":"string","enum":["bad_request"]},"title":{"type":"string","enum":["Bad Request"]},"details":{"type":"object","unevaluatedProperties":{"type":"array","items":{"type":"string"}},"description":"Maps each invalid argument to the list of validation messages for that argument."}},"description":"Error object for invalid request arguments, adding per-argument messages."},"Meta.MetaActionTimeout":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["timeout"]}},"description":"The request to the channel took too long and was aborted; retry later."},"Meta.AirbnbConnectionLinkRequest":{"type":"object","required":["connection_link"],"properties":{"connection_link":{"$ref":"#/components/schemas/Meta.AirbnbConnectionLinkInput"}},"description":"Request payload of the connection link generation."},"Meta.AirbnbConnectionLinkInput":{"type":"object","required":["group_id","properties"],"properties":{"group_id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"Group the created channel connection will belong to."},"properties":{"type":"array","items":{"$ref":"#/components/schemas/Common.Scalars.id"},"minItems":1,"description":"Properties to associate with the connection. Multiple properties can be\nconnected through one Airbnb connection."},"channel_id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"Existing channel connection ID — used in the re-connection flow of an\nalready created connection."},"redirect_uri":{"type":"string","format":"uri","description":"Target endpoint for the redirect after the user authorizes Channex on\nAirbnb: the user is redirected there with the created connection's\n`channel_id` and the submitted `token` appended."},"failure_redirect_uri":{"type":"string","format":"uri","description":"Target endpoint for the redirect when the connection fails."},"token":{"type":"string","description":"Free-form value echoed back in the success redirect. Use it to associate\nthe incoming redirect with a specific user or session in your system."},"title":{"type":"string","description":"Title for the created channel connection."},"settings":{"type":"object","unevaluatedProperties":{},"description":"Settings of the channel connection to create; stored on the connection\nwhen it is created. Recognized keys:\n\n- `min_stay_type` — `Arrival` or `Through`: which of the property's\n  minimum-stay restrictions is sent to Airbnb (Airbnb supports a single\n  minimum-stay type).\n- `booking_amount_settings` — `Payout Amount` or `Total Paid Amount`:\n  which total is saved on bookings.\n- `cohost_payout_calculations` — boolean: decrease booking amounts by the\n  co-host commission.\n- `send_email_notifications` — boolean: send email notifications about\n  new bookings.\n- `email` — the address for those notifications; used when\n  `send_email_notifications` is enabled."}},"description":"Parameters of the Airbnb connection link to generate."},"Common.Scalars.id":{"type":"string","format":"uuid"}}}}
```

Pass the group and the properties the new connection should belong to. Multiple properties can be connected through one Airbnb connection.

Three fields shape the flow for an external application:

* **`redirect_uri`** — where the user lands after a successful authorization. Channex appends `?success=true&channel_id={channel_id}&token={token}`: the ID of the created connection and your `token` echoed back.
* **`failure_redirect_uri`** — where the user lands when the connection fails. Channex appends `?success=false`.
* **`token`** — a free-form value of yours (a session key, a user ID) to associate the incoming redirect with the right user in your system.

The `settings` object becomes the connection's settings once it is created — see the settings reference below.

The returned `url` is the Airbnb authorization page. Hand it to the property owner; it is valid for two hours.

### 2. The authorization and the created connection

When the owner authorizes Channex on Airbnb, Channex creates the channel connection automatically and redirects the browser to your `redirect_uri`. The connection starts **inactive** — it is the connection you now map and activate. Its default title is `New AirBNB Channel` unless a `title` was given at link generation.

One Airbnb account holds one connection. To re-connect an existing connection (for example, after its authorization was revoked), generate a new link with its `channel_id` — the owner re-authorizes, and the tokens are refreshed on the same connection.

### 3. Read the connection

## Retrieve a channel connection

> Retrieve a single channel connection.\
> \
> Unlike the list, the response carries the connection's known mappings —\
> see the \`known\_mappings\` relationship.

```json
{"openapi":"3.1.0","info":{"title":"Channex.io — Channels","version":"0.0.0"},"tags":[{"name":"Channels","description":"Channel connections of Properties to booking channels (OTAs and channel managers), and the catalog of supported channel adapters."}],"servers":[{"url":"https://app.channex.io/api/v1","description":"Production server","variables":{}},{"url":"https://staging.channex.io/api/v1","description":"Staging server","variables":{}}],"security":[{"UserApiKeyAuth":[]}],"components":{"securitySchemes":{"UserApiKeyAuth":{"type":"apiKey","in":"header","name":"user-api-key","description":"API key for programmatic access, sent in the `user-api-key` header."}},"schemas":{"Common.Scalars.id":{"type":"string","format":"uuid"},"Channels.Channel":{"type":"object","required":["id","title","channel","currency","is_active","settings","rate_plans","properties","actions","expected_removal_date","inserted_at","updated_at"],"properties":{"id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}]},"title":{"type":"string","description":"Title of the channel connection."},"channel":{"type":"string","description":"Adapter code of the channel. See the `/channels/list` endpoint for supported values."},"currency":{"anyOf":[{"$ref":"#/components/schemas/Common.Scalars.currency"},{"type":"null"}],"description":"Currency the channel connection trades in; `null` when the connection does not define one."},"is_active":{"type":"boolean","description":"Whether the channel connection is enabled. Disabled connections do not send updates to the channel. Read-only: use `POST /channels/{id}/activate` and `POST /channels/{id}/deactivate` to change it."},"settings":{"allOf":[{"$ref":"#/components/schemas/Channels.ChannelConnectionSettings"}],"description":"Connection settings. Apart from `derived_option`, the keys are defined by the channel adapter — see `params` in the adapter descriptor returned by `GET /channels/adapter`."},"rate_plans":{"type":"array","items":{"$ref":"#/components/schemas/Channels.ChannelRatePlanMapping"},"description":"Rate plans of the property mapped to rates of the channel. Empty while the connection is unmapped."},"properties":{"type":"array","items":{"$ref":"#/components/schemas/Common.Scalars.id"},"description":"UUIDs of the properties connected through this channel connection. Channel Adapters with `property_mapping` equal to `single` accept only 1 Property."},"actions":{"type":"array","items":{"type":"string"},"description":"Actions the channel adapter supports on this connection, invoked through `POST /channels/{id}/execute/{action}`. Possible values: `load_future_reservations`."},"expected_removal_date":{"anyOf":[{"type":"string"},{"type":"null"}],"format":"date","description":"Date the channel connection is scheduled to be removed on. `null` while no removal is scheduled. Get more information about retention period at [our docs](https://docs.channex.io/guides/channex-retention-periods)."},"inserted_at":{"type":"string","format":"date-time","description":"When the channel connection was created (ISO 8601, no timezone offset)."},"updated_at":{"type":"string","format":"date-time","description":"When the channel connection was last changed (ISO 8601, no timezone offset)."},"status":{"allOf":[{"$ref":"#/components/schemas/Channels.ChannelStatus"}],"description":"Connection status. Present on Google Hotel ARI channel connections only."}},"description":"A channel connection: the link between a property and a booking channel."},"Common.Scalars.currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO 4217 alphabetic currency code. See the `/currencies` endpoint for supported values."},"Channels.ChannelConnectionSettings":{"type":"object","properties":{"derived_option":{"allOf":[{"$ref":"#/components/schemas/RatePlans.DerivedOption"}],"description":"Value-modification rules applied to the values pushed to the channel: each\nlisted restriction is sent with the rules applied to the mapped rate\nplan's value. The rules take effect when a rate plan mapping is created or\nupdated. A `derived_option` in a mapping's own settings overrides the\nconnection-level rules restriction by restriction."}},"unevaluatedProperties":{},"description":"Connection settings of a channel connection. Apart from `derived_option`, the keys are defined by the channel adapter — see `params` in the adapter descriptor returned by `GET /channels/adapter`."},"RatePlans.DerivedOption":{"type":"object","unevaluatedProperties":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","enum":["increase_by_amount","increase_by_percent","decrease_by_amount","decrease_by_percent"],"description":"A value-modification rule applied to the original value."},{"type":"string"}]}},"description":"Value-modification rules for the `rate` restriction, keyed by restriction\nname. Each value is a list of modification steps applied to the original\nvalue in order, left to right; a step is a `[rule, argument]` pair whose\nargument is the amount or percent as a decimal string, e.g.\n`[\"increase_by_percent\", \"5.00\"]`."},"Channels.ChannelRatePlanMapping":{"type":"object","required":["id","rate_plan_id","settings"],"properties":{"id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"UUID of the mapping."},"rate_plan_id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"UUID of the mapped rate plan."},"settings":{"allOf":[{"$ref":"#/components/schemas/Channels.ChannelMappingSettings"}],"description":"Mapping settings. Apart from `derived_option`, the keys are defined by the channel adapter — see `rate_params` in the adapter descriptor returned by `GET /channels/adapter`."}},"description":"A rate plan of the property mapped to a rate of the channel."},"Channels.ChannelMappingSettings":{"type":"object","properties":{"derived_option":{"allOf":[{"$ref":"#/components/schemas/RatePlans.DerivedOption"}],"description":"Value-modification rules for this mapping, overriding the\nconnection-level `settings.derived_option` restriction by restriction: a\nrestriction listed here is sent with this mapping's rules instead of the\nconnection's, and a restriction listed only at the connection level keeps\nthe connection's rules."}},"unevaluatedProperties":{},"description":"Mapping settings of a rate plan mapping. Apart from `derived_option`, the keys are defined by the channel adapter — see `rate_params` in the adapter descriptor returned by `GET /channels/adapter`."},"Channels.ChannelStatus":{"type":"string","enum":["active","pending","temporal_error","permanent_error"],"description":"Connection status of a channel connection."},"Channels.ChannelReadRelationships":{"type":"object","required":["group","properties","known_mappings"],"properties":{"group":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}]},"type":{"type":"string","enum":["group"]}},"required":["id","type"]}},"required":["data"],"description":"Group the channel connection belongs to."},"properties":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}]},"type":{"type":"string","enum":["property"]}},"required":["id","type"]}}},"required":["data"],"description":"Properties connected through this channel connection."},"known_mappings":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Channels.KnownMappingResource"}}},"required":["data"],"description":"Known mappings of the channel connection. Empty for channels that do not collect them."}},"description":"Relationships of a single retrieved channel connection resource."},"Channels.KnownMappingResource":{"type":"object","required":["id","type","attributes"],"properties":{"id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}]},"type":{"type":"string","enum":["known_mapping"]},"attributes":{"$ref":"#/components/schemas/Channels.KnownMappingAttributes"}},"description":"A known mapping of a channel connection: a remembered link between a rate of\nthe channel — identified by its rate and room codes — and a rate plan and\nroom type of the property. Known mappings are used to map incoming bookings;\nthey are collected automatically for channels that expose derived rates, and\nwhen unmapped bookings are resolved."},"Channels.KnownMappingAttributes":{"type":"object","required":["id","type","rate_plan_code","room_type_code","rate_plan_id","room_type_id"],"properties":{"id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"UUID of the known mapping."},"type":{"type":"string","enum":["auto","manual"],"description":"How the mapping was established: derived from the channel's rate tree automatically, or set manually."},"rate_plan_code":{"type":"string","description":"Rate code on the channel side."},"room_type_code":{"type":"string","description":"Room code on the channel side."},"rate_plan_id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"UUID of the mapped rate plan."},"room_type_id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"UUID of the mapped room type."}},"description":"Attributes of a known mapping."},"Common.Errors.Unauthorized":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"title":{"type":"string","enum":["Unauthorized"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"Authentication credentials are missing or invalid."},"Common.Errors.Forbidden":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["forbidden"]},"title":{"type":"string","enum":["Forbidden"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"The authenticated user lacks permission to perform this action."},"Common.Errors.NotFound":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["resource_not_found"]},"title":{"type":"string","enum":["Resource Not Found"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"The requested resource does not exist."},"Common.Errors.ServiceUnavailable":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["service_unavailable"]},"title":{"type":"string","enum":["Service Temporary Unavailable"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"A backing service is temporarily unavailable; retry the request later."}}},"paths":{"/channels/{id}":{"get":{"operationId":"Channels_read","summary":"Retrieve a channel connection","description":"Retrieve a single channel connection.\n\nUnlike the list, the response carries the connection's known mappings —\nsee the `known_mappings` relationship.","parameters":[{"name":"id","in":"path","required":true,"description":"Channel connection ID.","schema":{"$ref":"#/components/schemas/Common.Scalars.id"}}],"responses":{"200":{"description":"The request has succeeded.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["type","id","attributes","relationships"],"properties":{"type":{"type":"string","enum":["channel"]},"id":{"$ref":"#/components/schemas/Common.Scalars.id"},"attributes":{"$ref":"#/components/schemas/Channels.Channel"},"relationships":{"$ref":"#/components/schemas/Channels.ChannelReadRelationships"}},"description":"A JSON:API resource object with typed attributes and relationships."}},"description":"JSON:API document wrapping a single resource."}}}},"401":{"description":"Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.Unauthorized"}}}},"403":{"description":"The authenticated user lacks permission to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.Forbidden"}}}},"404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.NotFound"}}}},"503":{"description":"A backing service is temporarily unavailable; retry the request later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.ServiceUnavailable"}}}}},"tags":["Channels"]}}}}
```

Use the `channel_id` from the redirect. The interesting parts of an Airbnb connection are its `settings` (the values submitted with the link, plus the OAuth tokens managed by Channex) and `rate_plans` — the listing mappings, empty so far.

### 4. Discover the listings

## List Airbnb listings

> List the Airbnb listings of the channel connection's Airbnb account:\
> identifier, title, type, location, occupancy options, quality status, and\
> synchronization category of each listing. The listing identifiers are\
> used to map listings — see \`POST /channels/{channel\_id}/mappings\`.\
> Listings without a title are omitted.\
> \
> The listings are requested from Airbnb. For Airbnb channel connections;\
> other channels receive \`400 Bad Request\`.

```json
{"openapi":"3.1.0","info":{"title":"Channex.io — Channels","version":"0.0.0"},"tags":[{"name":"Airbnb","description":"Airbnb-specific operations of channel connections: authorization, the listing settings stored on the rate plan mappings (pricing, availability, and booking settings), and listing promotions."}],"servers":[{"url":"https://app.channex.io/api/v1","description":"Production server","variables":{}},{"url":"https://staging.channex.io/api/v1","description":"Staging server","variables":{}}],"security":[{"UserApiKeyAuth":[]}],"components":{"securitySchemes":{"UserApiKeyAuth":{"type":"apiKey","in":"header","name":"user-api-key","description":"API key for programmatic access, sent in the `user-api-key` header."}},"schemas":{"Common.Scalars.id":{"type":"string","format":"uuid"},"Channels.AirbnbListingDictionary":{"type":"object","required":["listing_id_dictionary"],"properties":{"listing_id_dictionary":{"type":"object","properties":{"values":{"type":"array","items":{"$ref":"#/components/schemas/Channels.AirbnbListingItem"}}},"required":["values"]}},"description":"The Airbnb listings of a channel connection's Airbnb account."},"Channels.AirbnbListingItem":{"type":"object","required":["id","title","type","occupancies","synchronization_category","city","country_code","quality_status"],"properties":{"id":{"type":"string","description":"Airbnb listing ID. Used to map the listing — see `POST /channels/{channel_id}/mappings`."},"title":{"type":"string","description":"Listing title."},"type":{"type":"string","description":"Listing type."},"occupancies":{"type":"array","items":{"type":"integer","format":"int32"},"description":"Occupancy options of the listing: every guest count from 1 up to its capacity."},"synchronization_category":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Synchronization category of the listing. `null` when none is set."},"city":{"type":"string","description":"City of the listing."},"country_code":{"type":"string","description":"Country code of the listing."},"quality_status":{"type":"string","description":"Quality status of the listing."}},"description":"An Airbnb listing available for mapping."},"Common.Errors.BadRequest":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["bad_request"]},"title":{"type":"string","enum":["Bad Request"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"The request cannot be processed in the current state."},"Common.Errors.BadRequestWithReasons":{"type":"object","required":["errors"],"properties":{"errors":{"$ref":"#/components/schemas/Common.Errors.BadRequestReasonsObject"}},"description":"The request has missing or invalid arguments; `details` lists the reasons."},"Common.Errors.BadRequestReasonsObject":{"type":"object","required":["code","title","details"],"properties":{"code":{"type":"string","enum":["bad_request"]},"title":{"type":"string","enum":["Bad Request"]},"details":{"type":"array","items":{"type":"string"},"description":"Human-readable reasons the request could not be processed."}},"description":"Error object for a bad request, adding a list of human-readable reasons."},"Common.Errors.Unauthorized":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"title":{"type":"string","enum":["Unauthorized"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"Authentication credentials are missing or invalid."},"Common.Errors.Forbidden":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["forbidden"]},"title":{"type":"string","enum":["Forbidden"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"The authenticated user lacks permission to perform this action."},"Common.Errors.NotFound":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["resource_not_found"]},"title":{"type":"string","enum":["Resource Not Found"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"The requested resource does not exist."},"Channels.ChannelActionFailure":{"type":"object","required":["errors"],"properties":{"errors":{}},"description":"The channel could not return the details; `errors` carries the reason the channel reported, or `null` when it gave none."},"Common.Errors.ServiceUnavailable":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["service_unavailable"]},"title":{"type":"string","enum":["Service Temporary Unavailable"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"A backing service is temporarily unavailable; retry the request later."}}},"paths":{"/channels/{channel_id}/action/listings":{"get":{"operationId":"Channels_airbnbListings","summary":"List Airbnb listings","description":"List the Airbnb listings of the channel connection's Airbnb account:\nidentifier, title, type, location, occupancy options, quality status, and\nsynchronization category of each listing. The listing identifiers are\nused to map listings — see `POST /channels/{channel_id}/mappings`.\nListings without a title are omitted.\n\nThe listings are requested from Airbnb. For Airbnb channel connections;\nother channels receive `400 Bad Request`.","parameters":[{"name":"channel_id","in":"path","required":true,"description":"Channel connection ID.","schema":{"$ref":"#/components/schemas/Common.Scalars.id"}}],"responses":{"200":{"description":"The request has succeeded.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Channels.AirbnbListingDictionary"}},"description":"JSON:API document wrapping a single resource."}}}},"400":{"description":"The request cannot be processed in the current state.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Common.Errors.BadRequest"},{"$ref":"#/components/schemas/Common.Errors.BadRequestWithReasons"}]}}}},"401":{"description":"Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.Unauthorized"}}}},"403":{"description":"The authenticated user lacks permission to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.Forbidden"}}}},"404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.NotFound"}}}},"422":{"description":"The channel could not return the details; `errors` carries the reason the channel reported, or `null` when it gave none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Channels.ChannelActionFailure"}}}},"503":{"description":"A backing service is temporarily unavailable; retry the request later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.ServiceUnavailable"}}}}},"tags":["Airbnb"]}}}}
```

Returns the listings of the connected Airbnb account: identifier, title, type, location, occupancy options, quality status. The listing `id` is what a mapping needs.

For a deeper look at one listing — rooms and beds, amenities, photos, descriptions, and its current booking settings, pricing settings and availability rules:

## Retrieve the details of a listing

> Retrieve the details of an Airbnb listing: the listing record as Airbnb\
> reports it — location, capacity, rooms and beds, amenities, photos,\
> descriptions — supplemented with the listing's booking settings, pricing\
> settings, and availability rules.\
> \
> The details are requested from Airbnb. For Airbnb channel connections;\
> other channels receive \`400 Bad Request\`.

```json
{"openapi":"3.1.0","info":{"title":"Channex.io — Channels","version":"0.0.0"},"tags":[{"name":"Airbnb","description":"Airbnb-specific operations of channel connections: authorization, the listing settings stored on the rate plan mappings (pricing, availability, and booking settings), and listing promotions."}],"servers":[{"url":"https://app.channex.io/api/v1","description":"Production server","variables":{}},{"url":"https://staging.channex.io/api/v1","description":"Staging server","variables":{}}],"security":[{"UserApiKeyAuth":[]}],"components":{"securitySchemes":{"UserApiKeyAuth":{"type":"apiKey","in":"header","name":"user-api-key","description":"API key for programmatic access, sent in the `user-api-key` header."}},"schemas":{"Common.Scalars.id":{"type":"string","format":"uuid"},"Channels.AirbnbListingDetails":{"type":"object","required":["listing"],"properties":{"listing":{"allOf":[{"$ref":"#/components/schemas/Channels.AirbnbListing"}]}},"description":"Details of an Airbnb listing, as Airbnb reports them: location, capacity,\nrooms and beds, amenities, photos, and descriptions, supplemented with the\nlisting's `booking_settings`, `pricing_settings`, and `availability_rules`\nblocks — the same settings managed through the mapping settings operations."},"Channels.AirbnbListing":{"type":"object","required":["images","rooms","descriptions","booking_settings","pricing_settings","availability_rules"],"properties":{"images":{"anyOf":[{"type":"array","items":{"type":"object","unevaluatedProperties":{}}},{"type":"null"}],"description":"Photos of the listing, as Airbnb reports them. `null` when the listing has no photos."},"rooms":{"type":"array","items":{"type":"object","unevaluatedProperties":{}},"description":"Rooms of the listing with their beds, as Airbnb reports them."},"descriptions":{"anyOf":[{"type":"object","unevaluatedProperties":{}},{"type":"null"}],"description":"Descriptions of the listing — name, summary, space, access, and related\ntexts, as Airbnb reports them. `null` when the listing has no\ndescription."},"booking_settings":{"allOf":[{"$ref":"#/components/schemas/Channels.AirbnbListingBookingSettings"}],"description":"Booking settings of the listing. The same settings are updated through\n`PUT /channels/{channel_id}/execute/update_booking_setting`."},"pricing_settings":{"allOf":[{"$ref":"#/components/schemas/Channels.AirbnbListingPricingSettings"}],"description":"Pricing settings of the listing. The same settings are managed through\nthe mapping — see `GET /channels/{channel_id}/mappings/{id}/pricing_settings`."},"availability_rules":{"allOf":[{"$ref":"#/components/schemas/Channels.AirbnbListingAvailabilityRules"}],"description":"Availability rules of the listing. The same settings are managed through\nthe mapping — see `GET /channels/{channel_id}/mappings/{id}/availability_settings`."}},"unevaluatedProperties":{},"description":"An Airbnb listing: the listing record as Airbnb reports it — identity,\nlocation, capacity, amenities, and any further fields Airbnb returns for\nthe listing — supplemented with the listing's photos, rooms, descriptions,\nand settings blocks."},"Channels.AirbnbListingBookingSettings":{"type":"object","required":["instant_booking_allowed_category","check_in_time_start","check_in_time_end","check_out_time","instant_book_welcome_message","cancellation_policy_settings","guest_controls","listing_expectations_for_guests"],"properties":{"instant_booking_allowed_category":{"anyOf":[{"type":"string","enum":["off"]},{"$ref":"#/components/schemas/Channels.AirbnbInstantBookingCategory"}],"description":"The category of guests that can create Instant Book reservations. `off`\nwhen Instant Book is disabled for the listing."},"check_in_time_start":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Earliest time a guest can check in: an hour from `\"8\"` to `\"26\"`,\n`\"FLEXIBLE\"`, or `\"NOT_SELECTED\"`."},"check_in_time_end":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Latest time a guest can check in: an hour from `\"8\"` to `\"27\"`,\n`\"FLEXIBLE\"`, or `\"NOT_SELECTED\"`."},"check_out_time":{"anyOf":[{"type":"integer","format":"int32"},{"type":"null"}],"description":"Latest time a guest can check out: an hour between 0 and 23."},"instant_book_welcome_message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Message guests must read and respond to before they confirm their reservation."},"cancellation_policy_settings":{"anyOf":[{"$ref":"#/components/schemas/Channels.AirbnbListingCancellationPolicySettings"},{"type":"null"}],"description":"Cancellation policy settings of the listing."},"guest_controls":{"anyOf":[{"$ref":"#/components/schemas/Channels.AirbnbListingGuestControls"},{"type":"null"}],"description":"Rules regarding children, pets, events, and smoking in the Host's space."},"listing_expectations_for_guests":{"type":"array","items":{"type":"object","properties":{"type":{"anyOf":[{"$ref":"#/components/schemas/Channels.AirbnbListingExpectationType"},{"type":"null"}]},"added_details":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["type","added_details"]},"description":"Expectations about the Host's space that guests must agree to before booking."}},"description":"Booking settings of an Airbnb listing, as reported in the listing details."},"Channels.AirbnbInstantBookingCategory":{"type":"string","enum":["everyone","well_reviewed_guests"],"description":"The category of guests that can create Instant Book reservations. Guests who\ndon't meet the requirement can send booking requests instead."},"Channels.AirbnbListingCancellationPolicySettings":{"type":"object","required":["cancellation_policy_category","lts_cancellation_policy_id","non_refundable_price_factor"],"properties":{"cancellation_policy_category":{"anyOf":[{"$ref":"#/components/schemas/Channels.AirbnbCancellationPolicyCategory"},{"type":"null"}]},"lts_cancellation_policy_id":{"anyOf":[{"$ref":"#/components/schemas/Channels.AirbnbLtsCancellationPolicy"},{"type":"null"}]},"non_refundable_price_factor":{"anyOf":[{"type":"number","format":"double"},{"type":"null"}],"description":"Non-refundable discount factor, between 0 and 1. If set, the price\nmultiplied by this factor is offered to guests as a non-refundable rate\nalongside the standard rate."}},"description":"Cancellation policy settings of an Airbnb listing, as reported in the listing details."},"Channels.AirbnbCancellationPolicyCategory":{"type":"string","enum":["flexible","moderate","better_strict_with_grace_period","strict_14_with_grace_period","super_strict_30","super_strict_60","firm_14","flexible_new","moderate_new","strict_new","super_strict_30_new","super_strict_60_new"],"description":"Cancellation policy for the listing.\n\n| Value | Policy name on Airbnb | Description |\n| --- | --- | --- |\n| `flexible` | Flexible | Guests can cancel at least 24 hours before check-in for a full refund. If canceling after check-in, the Host receives 100% for each night the guest stays, plus one additional night. |\n| `moderate` | Moderate | Guests can cancel at least five days before check-in for a full refund. If canceling after that, the Host receives 100% for each night the guest stays, plus one additional night, and 50% for all unspent nights. |\n| `better_strict_with_grace_period` | Firm | Guests can cancel at least 30 days before check-in for a full refund. If canceling between seven and 30 days before check-in, the Host receives 50% for all nights; less than seven days before check-in, 100% for all nights. If booked fewer than 30 days before check-in, guests can cancel within 48 hours of booking and at least 14 days before check-in for a full refund. |\n| `strict_14_with_grace_period` | Strict | Guests can cancel within 48 hours of booking and at least 14 days before check-in for a full refund. If canceling more than 14 days before check-in but not within 48 hours of booking, the Host receives 50% for all nights; between seven and 14 days before check-in, 50% for all nights. After that, the Host receives 100% for all nights. |\n| `super_strict_30` | Super Strict 30 Days | Guests can cancel at least 30 days before check-in for a 50% refund. After that, the Host receives 100% for all nights. |\n| `super_strict_60` | Super Strict 60 Days | Guests can cancel at least 60 days before check-in for a 50% refund. After that, the Host receives 100% for all nights. |\n| `firm_14` | Limited | Guests who cancel seven to 14 days before check-in get 50% back. After that, their trip is non-refundable. |\n\n`super_strict_30` and `super_strict_60` are deprecated: they are accepted\nonly when the listing already uses them — changing a listing to either is\nrejected.\n\nThe policies with the `_new` suffix are available only in Italy:\n\n| Value | Policy name on Airbnb | Description |\n| --- | --- | --- |\n| `flexible_new` | Flexible | Guests can cancel at least 24 hours before check-in for a full refund. If canceling within 24 hours of check-in and by 12PM local time, the Host receives 100% for the first night and the guest a full refund for the remaining nights. If canceling after check-in, before 12PM local time, the guest receives a full refund for unspent nights, excluding fees; after 12PM local time, excluding that night and fees. |\n| `moderate_new` | Moderate | Guests can cancel at least seven days before check-in for a full refund. If canceling within seven days before check-in and by 12PM local time, the Host receives 50% of the accommodation cost. If canceling after check-in, before 12PM local time, the Host receives 50% for each unspent night; after 12PM local time, 50% for each unspent night, including that night. |\n| `strict_new` | Strict | Guests can cancel at least 30 days before check-in for a full refund. If canceling within 30 days before check-in and by 12PM local time, the Host receives 50% of the accommodation cost. If canceling after check-in, before 12PM local time, the Host receives 50% for each unspent night; after 12PM local time, 50% for each unspent night, including that night. |\n| `super_strict_30_new` | Super Strict 30 Days | Guests can cancel at least 30 days before check-in for a full refund. If canceling within 30 days before check-in and by 12PM local time, the Host receives 100% of the accommodation cost, excluding fees. |\n| `super_strict_60_new` | Super Strict 60 Days | Guests can cancel at least 60 days before check-in for a full refund. If canceling within 60 days before check-in and by 12PM local time, the Host receives 100% of the accommodation cost, excluding fees. |"},"Channels.AirbnbLtsCancellationPolicy":{"type":"string","enum":["CANCEL_LONG_TERM_FAIR","CANCEL_LONG_TERM_WITH_GRACE_PERIOD"],"description":"Long-term cancellation policy, applied to stays of 28 nights or longer.\nNot supported for listings in Italy.\n\n| Value | Policy name on Airbnb | Description |\n| --- | --- | --- |\n| `CANCEL_LONG_TERM_FAIR` | Firm | Guests can cancel at least 30 days before check-in for a full refund. After that, the Host receives 100% for all nights spent, plus 30 additional nights. If fewer than 30 days remain on the reservation when the guest cancels, the Host receives 100% for the remaining nights. |\n| `CANCEL_LONG_TERM_WITH_GRACE_PERIOD` | Strict | Guests can cancel within 48 hours of booking and at least 28 days before check-in for a full refund. After that, the Host receives 100% for all nights spent, plus 30 additional nights. If fewer than 30 days remain on the reservation when the guest cancels, the Host receives 100% for the remaining nights. |"},"Channels.AirbnbListingGuestControls":{"type":"object","required":["allows_children_as_host","allows_infants_as_host","children_not_allowed_details","allows_pets_as_host","pet_capacity","allows_smoking_as_host","allows_events_as_host"],"properties":{"allows_children_as_host":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether the listing is suitable for children (2–12 years)."},"allows_infants_as_host":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether the listing is suitable for infants (under 2 years)."},"children_not_allowed_details":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Details explaining why the property may not be safe for children."},"allows_pets_as_host":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether pets are allowed."},"pet_capacity":{"anyOf":[{"type":"integer","format":"int32"},{"type":"null"}],"description":"Maximum number of pets the listing can accommodate."},"allows_smoking_as_host":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether smoking is allowed."},"allows_events_as_host":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether parties or events are allowed."}},"description":"Rules regarding children, pets, events, and smoking in the Host's space, as reported in the listing details."},"Channels.AirbnbListingExpectationType":{"type":"string","enum":["requires_stairs","potential_noise","has_pets","limited_parking","shared_spaces","limited_amenities","surveillance","noise_monitor","weapons","animals","pool_or_jacuzzi_with_no_fence","lake_or_river_or_water_body","climbing_or_play_structure","heights_with_no_fence"],"description":"The type of an expectation guests must agree to.\n\n| Value | Description |\n| --- | --- |\n| `requires_stairs` | Must climb stairs. Describe the stairs (for example, how many flights). |\n| `potential_noise` | Potential for noise. Describe the noise and when it's likely to take place. |\n| `has_pets` | Pet(s) live on property. Describe the pets. |\n| `limited_parking` | No parking on property. Describe the parking situation around the listing. |\n| `shared_spaces` | Some spaces are shared. Describe the spaces the guests will share. |\n| `limited_amenities` | Amenity limitations. Describe an amenity or service that's limited, such as weak wifi or limited hot water. |\n| `surveillance` | Surveillance or recording devices on property. Describe any device that records or sends video, audio, or still images; specify each device's location and whether it will be on or off. |\n| `noise_monitor` | Noise decibel monitor on property — a device that assesses sound levels and their duration without recording audio. Specify the device's location. Not currently displayed to guests on Airbnb. |\n| `weapons` | Weapons on property. Describe any weapons (firearms, airguns, tasers, etc.), their location, and how they're secured. |\n| `animals` | Dangerous animals on property. Describe any domesticated or wild animals that could be a health or safety risk to guests or other animals. |\n| `pool_or_jacuzzi_with_no_fence` | Pool or hot tub without a gate or lock. Describe the pool or hot tub and how guests will have access to it. |\n| `lake_or_river_or_water_body` | Nearby lake, river, or other body of water. Describe the body of water, its location, and how guests will have access to it. |\n| `climbing_or_play_structure` | Climbing or play structure. Describe the climbing or play structure. |\n| `heights_with_no_fence` | Heights without rails or protection. Describe the unprotected elevated area and how guests will have access to it. |"},"Channels.AirbnbListingPricingSettings":{"type":"object","required":["default_daily_price","listing_currency","standard_fees","weekly_price_factor","monthly_price_factor"],"properties":{"default_daily_price":{"anyOf":[{"type":"integer","format":"int32"},{"type":"null"}],"description":"Default nightly price of the listing."},"listing_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Listing currency in ISO 4217 format."},"standard_fees":{"type":"array","items":{"type":"object","unevaluatedProperties":{}},"description":"Standard fees applied to the listing."},"weekly_price_factor":{"type":"number","format":"double","description":"Weekly discount factor, derived from the listing's length-of-stay discount rules. `0` when the listing has none."},"monthly_price_factor":{"type":"number","format":"double","description":"Monthly discount factor, derived from the listing's length-of-stay discount rules. `0` when the listing has none."},"cleaning_fee":{"anyOf":[{"type":"integer","format":"int32"},{"type":"null"}],"description":"Cleaning fee of the listing."},"security_deposit":{"anyOf":[{"type":"integer","format":"int32"},{"type":"null"}],"description":"Security deposit of the listing."},"guests_included":{"anyOf":[{"type":"integer","format":"int32"},{"type":"null"}],"description":"Number of guests permitted without additional fees."},"price_per_extra_person":{"anyOf":[{"type":"integer","format":"int32"},{"type":"null"}],"description":"Price per guest per night for each guest beyond `guests_included`."},"weekend_price":{"anyOf":[{"type":"integer","format":"int32"},{"type":"null"}],"description":"Nightly price applied on weekend days."},"eligible_for_pass_through_taxes":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether the listing is eligible for pass-through occupancy taxes."},"pass_through_taxes":{"anyOf":[{"type":"array","items":{"type":"object","unevaluatedProperties":{}}},{"type":"null"}],"description":"Pass-through occupancy taxes applied to the listing."},"pass_through_taxes_collection_type":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The pass-through-tax collection type applied to the listing. See the pricing settings of the listing's mapping for the value set."},"default_pass_through_taxes_collection_type":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The default pass-through-tax collection type of the listing."},"allowed_pass_through_taxes_collection_types":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"The pass-through-tax collection types the listing is allowed to use."},"default_pricing_rules":{"type":"array","items":{"type":"object","unevaluatedProperties":{}},"description":"Default pricing rules applied to the listing. Reported for listings on the standard pricing model."}},"description":"Pricing settings of an Airbnb listing, as reported in the listing details.\n\nListings on the standard pricing model report the full set of fields,\nincluding `default_pricing_rules`; listings on the length-of-stay and\nrate-plan pricing models omit the fields Airbnb reports no value for and\ndo not report `default_pricing_rules`."},"Channels.AirbnbListingAvailabilityRules":{"type":"object","required":["booking_lead_time","max_days_notice","allow_rtb_beyond_max_days_notice","default_min_nights","default_max_nights","allow_rtb_above_max_nights","turnover_days"],"properties":{"booking_lead_time":{"anyOf":[{"type":"integer","format":"int32"},{"type":"null"}],"description":"Minimum notice required before guests can book, in hours."},"max_days_notice":{"anyOf":[{"type":"integer","format":"int32"},{"type":"null"}],"description":"Maximum number of days between the booking date and the check-in date. `-1` means no limit."},"allow_rtb_beyond_max_days_notice":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether guests can create a Request to Book for reservations starting beyond the `max_days_notice` window."},"default_min_nights":{"anyOf":[{"type":"integer","format":"int32"},{"type":"null"}],"description":"Default minimum-nights requirement."},"default_max_nights":{"anyOf":[{"type":"integer","format":"int32"},{"type":"null"}],"description":"Default maximum-nights requirement."},"allow_rtb_above_max_nights":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether guests can create a Request to Book for stays above `default_max_nights`."},"turnover_days":{"anyOf":[{"type":"integer","format":"int32"},{"type":"null"}],"description":"Number of days the host requires for preparation between reservations."},"seasonal_min_nights":{"anyOf":[{"type":"array","items":{"type":"object","unevaluatedProperties":{}}},{"type":"null"}],"description":"Minimum-nights rules for specific date ranges."},"day_of_week_check_in":{"type":"array","items":{"type":"boolean"},"minItems":7,"maxItems":7,"description":"Weekdays guests are allowed to check in on: seven booleans starting with Monday. Reported for listings on the standard pricing model."},"day_of_week_check_out":{"type":"array","items":{"type":"boolean"},"minItems":7,"maxItems":7,"description":"Weekdays guests are allowed to check out on: seven booleans starting with Monday. Reported for listings on the standard pricing model."},"day_of_week_min_nights":{"type":"array","items":{"type":"integer","format":"int32"},"minItems":7,"maxItems":7,"description":"Minimum number of nights when the reservation starts on each weekday: seven values starting with Monday, `-1` meaning no weekday rule. Reported for listings on the standard pricing model."}},"description":"Availability rules of an Airbnb listing, as reported in the listing\ndetails.\n\nListings on the standard pricing model additionally report the weekday\ncheck-in, check-out, and minimum-nights fields; listings on the\nlength-of-stay and rate-plan pricing models report `seasonal_min_nights`\nonly when the listing has seasonal rules."},"Common.Errors.BadRequest":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["bad_request"]},"title":{"type":"string","enum":["Bad Request"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"The request cannot be processed in the current state."},"Common.Errors.BadRequestWithReasons":{"type":"object","required":["errors"],"properties":{"errors":{"$ref":"#/components/schemas/Common.Errors.BadRequestReasonsObject"}},"description":"The request has missing or invalid arguments; `details` lists the reasons."},"Common.Errors.BadRequestReasonsObject":{"type":"object","required":["code","title","details"],"properties":{"code":{"type":"string","enum":["bad_request"]},"title":{"type":"string","enum":["Bad Request"]},"details":{"type":"array","items":{"type":"string"},"description":"Human-readable reasons the request could not be processed."}},"description":"Error object for a bad request, adding a list of human-readable reasons."},"Common.Errors.Unauthorized":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"title":{"type":"string","enum":["Unauthorized"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"Authentication credentials are missing or invalid."},"Common.Errors.Forbidden":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["forbidden"]},"title":{"type":"string","enum":["Forbidden"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"The authenticated user lacks permission to perform this action."},"Common.Errors.NotFound":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["resource_not_found"]},"title":{"type":"string","enum":["Resource Not Found"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"The requested resource does not exist."},"Channels.ChannelActionFailure":{"type":"object","required":["errors"],"properties":{"errors":{}},"description":"The channel could not return the details; `errors` carries the reason the channel reported, or `null` when it gave none."},"Common.Errors.ServiceUnavailable":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["service_unavailable"]},"title":{"type":"string","enum":["Service Temporary Unavailable"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"A backing service is temporarily unavailable; retry the request later."}}},"paths":{"/channels/{channel_id}/action/listing_details":{"get":{"operationId":"Channels_airbnbListingDetails","summary":"Retrieve the details of a listing","description":"Retrieve the details of an Airbnb listing: the listing record as Airbnb\nreports it — location, capacity, rooms and beds, amenities, photos,\ndescriptions — supplemented with the listing's booking settings, pricing\nsettings, and availability rules.\n\nThe details are requested from Airbnb. For Airbnb channel connections;\nother channels receive `400 Bad Request`.","parameters":[{"name":"channel_id","in":"path","required":true,"description":"Channel connection ID.","schema":{"$ref":"#/components/schemas/Common.Scalars.id"}},{"name":"listing_id","in":"query","required":true,"description":"Airbnb listing ID.","schema":{"type":"string"},"explode":false}],"responses":{"200":{"description":"The request has succeeded.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Channels.AirbnbListingDetails"}},"description":"JSON:API document wrapping a single resource."}}}},"400":{"description":"The request cannot be processed in the current state.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Common.Errors.BadRequest"},{"$ref":"#/components/schemas/Common.Errors.BadRequestWithReasons"}]}}}},"401":{"description":"Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.Unauthorized"}}}},"403":{"description":"The authenticated user lacks permission to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.Forbidden"}}}},"404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.NotFound"}}}},"422":{"description":"The channel could not return the details; `errors` carries the reason the channel reported, or `null` when it gave none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Channels.ChannelActionFailure"}}}},"503":{"description":"A backing service is temporarily unavailable; retry the request later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.ServiceUnavailable"}}}}},"tags":["Airbnb"]}}}}
```

### 5. Map the listings

Each Airbnb listing is mapped to a Channex rate plan with its own mapping object — one create call per listing:

## Create a rate plan mapping

> Create a rate plan mapping on a channel connection: associate a rate plan\
> of the property with a room and rate of the channel, described by the\
> adapter-specific \`settings\`. If the rate plan's property is not attached\
> to the channel connection yet, it is attached automatically. The stored\
> settings are the adapter's defaults merged with the submitted keys, and\
> the created mapping appears in the connection's \`rate\_plans\`. An ARI\
> synchronization of the new mapping is performed in the background.\
> \
> For Airbnb connections the settings are seeded from the listing's\
> availability rule and pricing settings, mapping the same listing twice is\
> rejected, and the mapping is submitted to Airbnb immediately — a failure\
> reported by Airbnb cancels the creation.

```json
{"openapi":"3.1.0","info":{"title":"Channex.io — Channels","version":"0.0.0"},"tags":[{"name":"Channels","description":"Channel connections of Properties to booking channels (OTAs and channel managers), and the catalog of supported channel adapters."}],"servers":[{"url":"https://app.channex.io/api/v1","description":"Production server","variables":{}},{"url":"https://staging.channex.io/api/v1","description":"Staging server","variables":{}}],"security":[{"UserApiKeyAuth":[]}],"components":{"securitySchemes":{"UserApiKeyAuth":{"type":"apiKey","in":"header","name":"user-api-key","description":"API key for programmatic access, sent in the `user-api-key` header."}},"schemas":{"Common.Scalars.id":{"type":"string","format":"uuid"},"Channels.ChannelRatePlanAttributes":{"type":"object","required":["id","settings"],"properties":{"id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"UUID of the mapping — the `rate_plans[].id` of the channel connection."},"settings":{"allOf":[{"$ref":"#/components/schemas/Channels.ChannelMappingSettings"}],"description":"Stored mapping settings: the adapter's defaults merged with the submitted\nkeys. For Airbnb connections they carry the listing state, including its\navailability rule and pricing settings (the `availability_rule` and\n`pricing_setting` blocks), which are managed through the Airbnb listing\nsettings operations."}},"description":"Attributes of a rate plan mapping."},"Channels.ChannelMappingSettings":{"type":"object","properties":{"derived_option":{"allOf":[{"$ref":"#/components/schemas/RatePlans.DerivedOption"}],"description":"Value-modification rules for this mapping, overriding the\nconnection-level `settings.derived_option` restriction by restriction: a\nrestriction listed here is sent with this mapping's rules instead of the\nconnection's, and a restriction listed only at the connection level keeps\nthe connection's rules."}},"unevaluatedProperties":{},"description":"Mapping settings of a rate plan mapping. Apart from `derived_option`, the keys are defined by the channel adapter — see `rate_params` in the adapter descriptor returned by `GET /channels/adapter`."},"RatePlans.DerivedOption":{"type":"object","unevaluatedProperties":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","enum":["increase_by_amount","increase_by_percent","decrease_by_amount","decrease_by_percent"],"description":"A value-modification rule applied to the original value."},{"type":"string"}]}},"description":"Value-modification rules for the `rate` restriction, keyed by restriction\nname. Each value is a list of modification steps applied to the original\nvalue in order, left to right; a step is a `[rule, argument]` pair whose\nargument is the amount or percent as a decimal string, e.g.\n`[\"increase_by_percent\", \"5.00\"]`."},"Channels.ChannelRatePlanRelationships":{"type":"object","required":["channel"],"properties":{"channel":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}]},"type":{"type":"string","enum":["channel"]}},"required":["id","type"]}},"required":["data"],"description":"The channel connection the mapping belongs to."}},"description":"Relationships of a rate plan mapping resource."},"Common.Errors.Unauthorized":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"title":{"type":"string","enum":["Unauthorized"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"Authentication credentials are missing or invalid."},"Common.Errors.NotFound":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["resource_not_found"]},"title":{"type":"string","enum":["Resource Not Found"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"The requested resource does not exist."},"Common.Errors.InvalidArguments":{"type":"object","required":["errors"],"properties":{"errors":{"$ref":"#/components/schemas/Common.Errors.InvalidArgumentsObject"}},"description":"The request has missing or invalid arguments; `details` lists the messages per argument."},"Common.Errors.InvalidArgumentsObject":{"type":"object","required":["code","title","details"],"properties":{"code":{"type":"string","enum":["bad_request"]},"title":{"type":"string","enum":["Bad Request"]},"details":{"type":"object","unevaluatedProperties":{"type":"array","items":{"type":"string"}},"description":"Maps each invalid argument to the list of validation messages for that argument."}},"description":"Error object for invalid request arguments, adding per-argument messages."},"Common.Errors.ValidationError":{"type":"object","required":["errors"],"properties":{"errors":{"$ref":"#/components/schemas/Common.Errors.ValidationErrorObject"}},"description":"The request body failed validation."},"Common.Errors.ValidationErrorObject":{"type":"object","required":["code","title","details"],"properties":{"code":{"type":"string","enum":["validation_error"]},"title":{"type":"string","enum":["Validation Error"]},"details":{"type":"object","unevaluatedProperties":{"type":"array","items":{"type":"string"}},"description":"Maps each invalid field to the list of validation messages for that field."}},"description":"Error object for a failed validation, adding per-field messages."},"Common.Errors.ServiceUnavailable":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["service_unavailable"]},"title":{"type":"string","enum":["Service Temporary Unavailable"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"A backing service is temporarily unavailable; retry the request later."},"Channels.ChannelMappingRequest":{"type":"object","required":["mapping"],"properties":{"mapping":{"$ref":"#/components/schemas/Channels.ChannelMappingInput"}},"description":"Request payload of the mapping create and update operations."},"Channels.ChannelMappingInput":{"type":"object","required":["rate_plan_id","settings"],"properties":{"rate_plan_id":{"allOf":[{"$ref":"#/components/schemas/Common.Scalars.id"}],"description":"UUID of the property's rate plan to map."},"settings":{"allOf":[{"$ref":"#/components/schemas/Channels.ChannelMappingSettings"}],"description":"Mapping settings associating the rate plan with a room and rate of the\nchannel. Apart from `derived_option`, the keys are defined by the channel\nadapter — the `rate_params` of the adapter descriptor (see\n`GET /channels/adapter`). For Airbnb the listing is identified by\n`listing_id`."}},"description":"A rate plan mapping to create or update: the rate plan and the\nadapter-specific settings that associate it with a room and rate of the\nchannel."}}},"paths":{"/channels/{channel_id}/mappings":{"post":{"operationId":"Channels_createMapping","summary":"Create a rate plan mapping","description":"Create a rate plan mapping on a channel connection: associate a rate plan\nof the property with a room and rate of the channel, described by the\nadapter-specific `settings`. If the rate plan's property is not attached\nto the channel connection yet, it is attached automatically. The stored\nsettings are the adapter's defaults merged with the submitted keys, and\nthe created mapping appears in the connection's `rate_plans`. An ARI\nsynchronization of the new mapping is performed in the background.\n\nFor Airbnb connections the settings are seeded from the listing's\navailability rule and pricing settings, mapping the same listing twice is\nrejected, and the mapping is submitted to Airbnb immediately — a failure\nreported by Airbnb cancels the creation.","parameters":[{"name":"channel_id","in":"path","required":true,"description":"Channel connection ID.","schema":{"$ref":"#/components/schemas/Common.Scalars.id"}}],"responses":{"200":{"description":"The request has succeeded.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["type","id","attributes","relationships"],"properties":{"type":{"type":"string","enum":["channel_rate_plan"]},"id":{"$ref":"#/components/schemas/Common.Scalars.id"},"attributes":{"$ref":"#/components/schemas/Channels.ChannelRatePlanAttributes"},"relationships":{"$ref":"#/components/schemas/Channels.ChannelRatePlanRelationships"}},"description":"A JSON:API resource object with typed attributes and relationships."}},"description":"JSON:API document wrapping a single resource."}}}},"401":{"description":"Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.Unauthorized"}}}},"404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.NotFound"}}}},"422":{"description":"The request has missing or invalid arguments; `details` lists the messages per argument.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Common.Errors.InvalidArguments"},{"$ref":"#/components/schemas/Common.Errors.ValidationError"}]}}}},"503":{"description":"A backing service is temporarily unavailable; retry the request later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.ServiceUnavailable"}}}}},"tags":["Channels"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Channels.ChannelMappingRequest"}}}}}}}}
```

{% hint style="warning" %}
Airbnb Create Mapping API is async and take about 30 seconds to connect and receive all required information from Airbnb side.
{% endhint %}

For Airbnb the mapping `settings` carry the **`listing_id`** from step 4. On creation Channex seeds the mapping's settings from the listing itself — its availability rule and pricing settings — and submits the mapping to Airbnb immediately; mapping the same listing twice is rejected.

To remove a listing from the connection:

## Remove a rate plan mapping

> Remove a rate plan mapping from a channel connection. The removal is\
> propagated to the channel in the background.

```json
{"openapi":"3.1.0","info":{"title":"Channex.io — Channels","version":"0.0.0"},"tags":[{"name":"Channels","description":"Channel connections of Properties to booking channels (OTAs and channel managers), and the catalog of supported channel adapters."}],"servers":[{"url":"https://app.channex.io/api/v1","description":"Production server","variables":{}},{"url":"https://staging.channex.io/api/v1","description":"Staging server","variables":{}}],"security":[{"UserApiKeyAuth":[]}],"components":{"securitySchemes":{"UserApiKeyAuth":{"type":"apiKey","in":"header","name":"user-api-key","description":"API key for programmatic access, sent in the `user-api-key` header."}},"schemas":{"Common.Scalars.id":{"type":"string","format":"uuid"},"Common.JsonApi.SuccessMessage":{"type":"object","required":["meta"],"properties":{"meta":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"description":"Success response carrying only a meta message (no resource body)."},"Common.Errors.Unauthorized":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"title":{"type":"string","enum":["Unauthorized"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"Authentication credentials are missing or invalid."},"Common.Errors.NotFound":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["resource_not_found"]},"title":{"type":"string","enum":["Resource Not Found"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"The requested resource does not exist."},"Common.Errors.ServiceUnavailable":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["service_unavailable"]},"title":{"type":"string","enum":["Service Temporary Unavailable"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"A backing service is temporarily unavailable; retry the request later."}}},"paths":{"/channels/{channel_id}/mappings/{mapping_id}":{"delete":{"operationId":"Channels_deleteMapping","summary":"Remove a rate plan mapping","description":"Remove a rate plan mapping from a channel connection. The removal is\npropagated to the channel in the background.","parameters":[{"name":"channel_id","in":"path","required":true,"description":"Channel connection ID.","schema":{"$ref":"#/components/schemas/Common.Scalars.id"}},{"name":"mapping_id","in":"path","required":true,"description":"Mapping ID — the `rate_plans[].id` of the channel connection.","schema":{"$ref":"#/components/schemas/Common.Scalars.id"}}],"responses":{"200":{"description":"The request has succeeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.JsonApi.SuccessMessage"}}}},"401":{"description":"Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.Unauthorized"}}}},"404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.NotFound"}}}},"503":{"description":"A backing service is temporarily unavailable; retry the request later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.ServiceUnavailable"}}}}},"tags":["Channels"]}}}}
```

{% hint style="warning" %}
Airbnb Remove Mapping API is async and take about 30 seconds to receive confirmation from Airbnb side. On re-mapping flow, please, add a pause between remove and create mapping requests.
{% endhint %}

### 6. Activate the connection

## Activate a channel connection

> Activate a channel connection. The connection starts exchanging data with\
> the channel: a full synchronisation pushes availability, rates and\
> restrictions, and any scheduled removal date is cleared. Reviews and\
> scores begin to be collected for Airbnb, Booking.com and Expedia\
> connections.\
> \
> The connection must be mapped first — it needs at least one property, and\
> at least one mapped rate plan unless the channel does not require rate\
> mapping. Activating an already active connection succeeds without changes.

```json
{"openapi":"3.1.0","info":{"title":"Channex.io — Channels","version":"0.0.0"},"tags":[{"name":"Channels","description":"Channel connections of Properties to booking channels (OTAs and channel managers), and the catalog of supported channel adapters."}],"servers":[{"url":"https://app.channex.io/api/v1","description":"Production server","variables":{}},{"url":"https://staging.channex.io/api/v1","description":"Staging server","variables":{}}],"security":[{"UserApiKeyAuth":[]}],"components":{"securitySchemes":{"UserApiKeyAuth":{"type":"apiKey","in":"header","name":"user-api-key","description":"API key for programmatic access, sent in the `user-api-key` header."}},"schemas":{"Common.Scalars.id":{"type":"string","format":"uuid"},"Common.JsonApi.SuccessMessage":{"type":"object","required":["meta"],"properties":{"meta":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"description":"Success response carrying only a meta message (no resource body)."},"Common.Errors.Unauthorized":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"title":{"type":"string","enum":["Unauthorized"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"Authentication credentials are missing or invalid."},"Common.Errors.Forbidden":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["forbidden"]},"title":{"type":"string","enum":["Forbidden"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"The authenticated user lacks permission to perform this action."},"Common.Errors.NotFound":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["resource_not_found"]},"title":{"type":"string","enum":["Resource Not Found"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"The requested resource does not exist."},"Common.Errors.ValidationError":{"type":"object","required":["errors"],"properties":{"errors":{"$ref":"#/components/schemas/Common.Errors.ValidationErrorObject"}},"description":"The request body failed validation."},"Common.Errors.ValidationErrorObject":{"type":"object","required":["code","title","details"],"properties":{"code":{"type":"string","enum":["validation_error"]},"title":{"type":"string","enum":["Validation Error"]},"details":{"type":"object","unevaluatedProperties":{"type":"array","items":{"type":"string"}},"description":"Maps each invalid field to the list of validation messages for that field."}},"description":"Error object for a failed validation, adding per-field messages."},"Common.Errors.ServiceUnavailable":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["service_unavailable"]},"title":{"type":"string","enum":["Service Temporary Unavailable"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"A backing service is temporarily unavailable; retry the request later."}}},"paths":{"/channels/{id}/activate":{"post":{"operationId":"Channels_activate","summary":"Activate a channel connection","description":"Activate a channel connection. The connection starts exchanging data with\nthe channel: a full synchronisation pushes availability, rates and\nrestrictions, and any scheduled removal date is cleared. Reviews and\nscores begin to be collected for Airbnb, Booking.com and Expedia\nconnections.\n\nThe connection must be mapped first — it needs at least one property, and\nat least one mapped rate plan unless the channel does not require rate\nmapping. Activating an already active connection succeeds without changes.","parameters":[{"name":"id","in":"path","required":true,"description":"Channel connection ID.","schema":{"$ref":"#/components/schemas/Common.Scalars.id"}}],"responses":{"200":{"description":"The request has succeeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.JsonApi.SuccessMessage"}}}},"401":{"description":"Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.Unauthorized"}}}},"403":{"description":"The authenticated user lacks permission to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.Forbidden"}}}},"404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.NotFound"}}}},"422":{"description":"The request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.ValidationError"}}}},"503":{"description":"A backing service is temporarily unavailable; retry the request later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.ServiceUnavailable"}}}}},"tags":["Channels"]}}}}
```

Activation requires at least one mapped rate plan. It starts the synchronization: Channex pushes the full current availability, rates and restrictions to Airbnb and begins collecting bookings, reviews and scores.

The counterpart is deactivation, which stops the synchronization but keeps the connection and its mappings:

## Deactivate a channel connection

> Deactivate a channel connection. The connection stops sending updates to\
> the channel, and its removal is scheduled for 30 days later — see\
> \`expected\_removal\_date\`. No synchronisation is sent to the channel.\
> \
> Existing mappings are kept. A connection spanning more than one property,\
> and an Airbnb connection, must have its rate plan mappings removed before\
> it can be deactivated. Deactivating an already inactive connection succeeds\
> without changes.

```json
{"openapi":"3.1.0","info":{"title":"Channex.io — Channels","version":"0.0.0"},"tags":[{"name":"Channels","description":"Channel connections of Properties to booking channels (OTAs and channel managers), and the catalog of supported channel adapters."}],"servers":[{"url":"https://app.channex.io/api/v1","description":"Production server","variables":{}},{"url":"https://staging.channex.io/api/v1","description":"Staging server","variables":{}}],"security":[{"UserApiKeyAuth":[]}],"components":{"securitySchemes":{"UserApiKeyAuth":{"type":"apiKey","in":"header","name":"user-api-key","description":"API key for programmatic access, sent in the `user-api-key` header."}},"schemas":{"Common.Scalars.id":{"type":"string","format":"uuid"},"Common.JsonApi.SuccessMessage":{"type":"object","required":["meta"],"properties":{"meta":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"description":"Success response carrying only a meta message (no resource body)."},"Common.Errors.Unauthorized":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["unauthorized"]},"title":{"type":"string","enum":["Unauthorized"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"Authentication credentials are missing or invalid."},"Common.Errors.Forbidden":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["forbidden"]},"title":{"type":"string","enum":["Forbidden"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"The authenticated user lacks permission to perform this action."},"Common.Errors.NotFound":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["resource_not_found"]},"title":{"type":"string","enum":["Resource Not Found"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"The requested resource does not exist."},"Common.Errors.ValidationError":{"type":"object","required":["errors"],"properties":{"errors":{"$ref":"#/components/schemas/Common.Errors.ValidationErrorObject"}},"description":"The request body failed validation."},"Common.Errors.ValidationErrorObject":{"type":"object","required":["code","title","details"],"properties":{"code":{"type":"string","enum":["validation_error"]},"title":{"type":"string","enum":["Validation Error"]},"details":{"type":"object","unevaluatedProperties":{"type":"array","items":{"type":"string"}},"description":"Maps each invalid field to the list of validation messages for that field."}},"description":"Error object for a failed validation, adding per-field messages."},"Common.Errors.ServiceUnavailable":{"type":"object","required":["errors"],"properties":{"errors":{"type":"object","required":["code","title"],"properties":{"code":{"type":"string","enum":["service_unavailable"]},"title":{"type":"string","enum":["Service Temporary Unavailable"]}},"description":"Shape of a single JSON:API error object: a stable machine code plus a human-readable title."}},"description":"A backing service is temporarily unavailable; retry the request later."}}},"paths":{"/channels/{id}/deactivate":{"post":{"operationId":"Channels_deactivate","summary":"Deactivate a channel connection","description":"Deactivate a channel connection. The connection stops sending updates to\nthe channel, and its removal is scheduled for 30 days later — see\n`expected_removal_date`. No synchronisation is sent to the channel.\n\nExisting mappings are kept. A connection spanning more than one property,\nand an Airbnb connection, must have its rate plan mappings removed before\nit can be deactivated. Deactivating an already inactive connection succeeds\nwithout changes.","parameters":[{"name":"id","in":"path","required":true,"description":"Channel connection ID.","schema":{"$ref":"#/components/schemas/Common.Scalars.id"}}],"responses":{"200":{"description":"The request has succeeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.JsonApi.SuccessMessage"}}}},"401":{"description":"Authentication credentials are missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.Unauthorized"}}}},"403":{"description":"The authenticated user lacks permission to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.Forbidden"}}}},"404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.NotFound"}}}},"422":{"description":"The request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.ValidationError"}}}},"503":{"description":"A backing service is temporarily unavailable; retry the request later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Common.Errors.ServiceUnavailable"}}}}},"tags":["Channels"]}}}}
```

### 7. Load the existing reservations

A freshly connected account usually already holds future reservations. Pull them into Channex:

```
POST /api/v1/channels/{channel_id}/execute/load_future_reservations
```

Body (optional):

```json
{
  "listing_id": "{{LISTING_ID}}"
}
```

The preferred form is per listing (`listing_id` in the body) — call it for each newly mapped listing. Without a body the load covers every mapped listing of the connection. The import runs in the background and does not trigger guest notifications or availability changes.

### Airbnb connection settings reference

The connection `settings`, submitted with the connection link and stored on the connection:

| Setting                      | Description                                                                                                                               |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `min_stay_type`              | `Arrival` or `Through` — which of the property's minimum-stay restrictions is sent to Airbnb. Airbnb supports a single minimum-stay type. |
| `booking_amount_settings`    | `Payout Amount` or `Total Paid Amount` — which total is saved on bookings.                                                                |
| `cohost_payout_calculations` | When `true`, booking amounts are decreased by the co-host commission.                                                                     |
| `send_email_notifications`   | When `true`, Channex sends email notifications about new bookings.                                                                        |
| `email`                      | The address the notifications go to.                                                                                                      |

When the connection's Airbnb authorization becomes invalid (revoked by the host, expired), bookings and synchronization stop — re-connect through a new connection link with the `channel_id`, as in step 1.
