CharterOpsCharterOps

API reference

Empty legs

Search, post and book empty legs.

Search available empty legs

GET/v1/empty-legs

Scope
read
Quota
Counts toward your allowance

Query parameters

  • fromstring

    1 to 20 characters.

  • tostring

    1 to 20 characters.

  • near_fromstring

  • near_tostring

  • radius_nmnumber

    More than 0 and up to 500. Defaults to 50.

  • from_datedate

  • to_datedate

  • category[]array of strings

    One ofpistonturboproplightmidsizesuper_midsizeheavyultra_long_rangehelicopter

  • seats_mininteger

    More than 0.

  • max_price_centsinteger

    0 or more.

  • registrationstring

    1 to 20 characters.

  • qstring

    Up to 120 characters.

  • sourcestring

    Up to 40 characters.

  • saved_operatorsboolean

    Defaults to false.

  • operator_idUUID

  • sortstring

    Defaults to window_start.

    One ofwindow_start-window_startprice_cents-price_centsroute-routecategory-categoryaircraft-aircraftseats-seatsoperator-operator

  • cursorstring

    Up to 2,000 characters.

  • limitinteger

    From 1 to 100. Defaults to 25.

Response

200 OK

Returns a page of empty leg objects in items, with next_cursor and total.

Errors

  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not found
  • 409 Conflict
  • 422 Unprocessable content
  • 429 Too many requests

Example request

curl "$CHARTEROPS_API_URL/v1/empty-legs" \
  --header "Authorization: Bearer $CHARTEROPS_API_KEY"

Post an empty leg

POST/v1/empty-legs

Scope
write
Quota
Does not count

Headers

  • Idempotency-KeystringRequired

    1 to 200 characters.

Request body

  • aircraft_typestringRequired

    1 to 20 characters.

  • fromstringRequired

    1 to 20 characters.

  • tostringRequired

    1 to 20 characters.

  • window_enddate-timeRequired

  • window_startdate-timeRequired

  • notesstring

    Up to 2,000 characters.

  • operator_idUUID

  • price_centsinteger

    0 or more.

  • registrationstring

    1 to 20 characters.

  • seatsinteger

    More than 0.

Response

201 Created

Returns the empty leg object.

Errors

  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not found
  • 409 Conflict
  • 422 Unprocessable content
  • 429 Too many requests

Example request

curl --request POST "$CHARTEROPS_API_URL/v1/empty-legs" \
  --header "Authorization: Bearer $CHARTEROPS_API_KEY" \
  --header "Idempotency-Key: $(uuidgen)" \
  --json @body.json

Read an empty leg

GET/v1/empty-legs/{id}

Scope
read
Quota
Counts toward your allowance

Path parameters

  • idUUIDRequired

Response

200 OK

Returns the empty leg object.

Errors

  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not found
  • 409 Conflict
  • 422 Unprocessable content
  • 429 Too many requests

Example request

curl "$CHARTEROPS_API_URL/v1/empty-legs/$ID" \
  --header "Authorization: Bearer $CHARTEROPS_API_KEY"

Update an available empty leg

PATCH/v1/empty-legs/{id}

Scope
write
Quota
Does not count

Path parameters

  • idUUIDRequired

Request body

  • aircraft_typestring

    1 to 20 characters.

  • fromstring

    1 to 20 characters.

  • notesstring

    Up to 2,000 characters.

  • operator_idUUID

  • price_centsinteger

    0 or more.

  • registrationstring

    1 to 20 characters.

  • seatsinteger

    More than 0.

  • tostring

    1 to 20 characters.

  • window_enddate-time

  • window_startdate-time

Response

200 OK

Returns the empty leg object.

Errors

  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not found
  • 409 Conflict
  • 422 Unprocessable content
  • 429 Too many requests

Example request

curl --request PATCH "$CHARTEROPS_API_URL/v1/empty-legs/$ID" \
  --header "Authorization: Bearer $CHARTEROPS_API_KEY" \
  --json @body.json

Book or withdraw an empty leg

POST/v1/empty-legs/{id}/transitions

Scope
write
Quota
Does not count

Path parameters

  • idUUIDRequired

Headers

  • Idempotency-KeystringRequired

    1 to 200 characters.

Request body

  • tostringRequired

    One ofbookedwithdrawn

Response

200 OK

Returns the empty leg object.

Errors

  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not found
  • 409 Conflict
  • 422 Unprocessable content
  • 429 Too many requests

Example request

curl --request POST "$CHARTEROPS_API_URL/v1/empty-legs/$ID/transitions" \
  --header "Authorization: Bearer $CHARTEROPS_API_KEY" \
  --header "Idempotency-Key: $(uuidgen)" \
  --json @body.json

Objects

Empty leg

  • aircraftobjectCan be null

    3 fields in aircraft
    • idUUID

    • registrationstring

    • typeobjectCan be null

      5 fields in type
      • categorystring

        One ofpistonturboproplightmidsizesuper_midsizeheavyultra_long_rangehelicopter

      • icao_designatorstring

      • idUUID

      • manufacturerstring

      • modelstring

  • aircraft_typeobject

    5 fields in aircraft_type
    • categorystring

      One ofpistonturboproplightmidsizesuper_midsizeheavyultra_long_rangehelicopter

    • icao_designatorstring

    • idUUID

    • manufacturerstring

    • modelstring

  • created_atdate-time

  • currencystring

  • distance_nminteger

  • fromobject

    10 fields in from
    • citystringCan be null

    • codestring

    • countrystring

    • iatastringCan be null

    • icaostringCan be null

    • idUUID

    • latitudenumber

    • longitudenumber

    • namestring

    • timezonestringCan be null

  • idUUID

  • inquiry_availableboolean

  • is_expiredboolean

  • is_ownboolean

  • notesstringCan be null

  • operatorobjectCan be null

    4 fields in operator
    • dba_namestringCan be null

    • designatorstring

    • idUUID

    • legal_namestring

  • operator_phonestringCan be null

  • operator_savedboolean

  • organization_namestring

  • photo_urlstringCan be null

  • price_centsintegerCan be null

  • seatsintegerCan be null

  • seller_idUUIDCan be null

  • sourcestring

  • source_namestringCan be null

  • source_urlstringCan be null

  • statusstring

    One ofactivebookedwithdrawn

  • toobject

    10 fields in to
    • citystringCan be null

    • codestring

    • countrystring

    • iatastringCan be null

    • icaostringCan be null

    • idUUID

    • latitudenumber

    • longitudenumber

    • namestring

    • timezonestringCan be null

  • updated_atdate-time

  • window_enddate-time

  • window_startdate-time