Guru API (1.0.0)

Download OpenAPI specification:

This is a collection of http methods based on the OpenAPI 3.0 specification to manage agencies airline tickets.

To test it you can download the Postman files for our API using the following links
- Download API Postman File
- Download Development Env Postman File
These files contain the necessary configurations and endpoints for testing and interacting with our API. If you have any questions or need further assistance, feel free to reach out!

To know more about us, access Agent Guru

Auth

This is the OAuth 2.0 password grant to access the API.
Use the endpoints to directly request an access token by using the application's credentials (Username and Password) and to renew an expired access_token using a refresh_token.

/oauth/token - Use the OAuth 2.0 password grant to request an access token.

Use this endpoint to directly request an access token by using the application's credentials (Username and Password).
The access token lasts 1 hour.

Request Body schema: application/json
required
username
string

Represents the unique identifier assigned to the client application that is making requests to the API.
For this API the username will be in a form of an e-mail.

Example: mymail@agency.com

password
string

Represents the password associated with the username, used to authenticate the client application when making requests to the API.

group_id
integer

(Optional) Group associated to the user. Created bookings will be registered to this specific group.

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string",
  • "group_id": 0
}

Response samples

Content type
application/json
{
  • "access_token": "string",
  • "token_type": "string",
  • "refresh_token": "string",
  • "expires_in": 0
}

/oauth/refreshtoken - Use the OAuth 2.0 refresh_token to request an access token.

Use this endpoint to directly request a new access token by using the refresh token issued previously. As a result of exchanging a refresh token, a new refresh token will be issued and the existing token will be invalidated. This allows for automatic detection of token reuse if the token is leaked.

The refresh token is valid for a duration of 24 hours.
Each time a new refresh token is generated, the previously issued token will be invalidated.

Request Body schema: application/json
required
refresh_token
string

Represents the refresh token issued in conjunction with the access token.

Example: v1.MQQ4tMbnZ_52--saQdBX7ybSMAFq-vQxtoxHy8F90EOiXgA4-WCkk5uLcsk6lzyoxNhzV4Kj7fe7j4E3NUsP5NM

Responses

Request samples

Content type
application/json
{
  • "refresh_token": "string"
}

Response samples

Content type
application/json
{
  • "access_token": "string",
  • "token_type": "string",
  • "refresh_token": "string",
  • "expires_in": 0
}

Shopping

The Airline Shopping Management API serves as a comprehensive solution for travel agencies to manage airline fares efficiently.
This API allows users to search for flights from different sources like GDSs and Direct Connect providers.

/offers - Obtain fares within a specified timeframe.

Obtain a list of fares during a specified date interval.
The maximum period is 330 days.

Authorizations:
bearerAuth
query Parameters
route
string

Specifies flight route as pipe-delimited string: origin,destination,outbound_date[+origin,destination,inbound_date]. Example: SAO,GIG,2026-02-10+GIG,SAO,2026-02-20 for São Paulo-Rio roundtrip (Feb 10-20).

provider_type
string (ProviderType)
Enum: "" "UNSPECIFIED" "AMADEUS" "FARELOGIX" "SABRE" "AZUL" "GOL" "LATAM" "ELATAM"

The airline's system.

airlines
Array of strings

List of preferred airlines.

adts
integer <int32>

Specifies the number of adults.

Example: 1
The limit is 9.

chds
integer <int32>

Specifies the number of children.

Example: 1
The limit is 9.

infs
integer <int32>

Specifies the number of infants.

Example: 1
The limit is 9.

cabin
string (Cabin)
Enum: "UNSPECIFIED" "ECONOMY" "PREMIUM" "BUSINESS" "FIRST"

Cabin class requested or booked for the flight.

  • UNSPECIFIED - Cabin class was not provided.
  • ECONOMY - Standard economy cabin.
  • PREMIUM - Premium economy or equivalent.
  • BUSINESS - Business class cabin.
  • FIRST - First class cabin.
direct_flights_only
boolean

If true, only direct flights will be included in the search.

cheapest_price_only
boolean

If true, only direct flights will be included in the search.

with_bags_only
boolean

If true, only flights with baggage are returned.

max_connections
integer <int32>

Maximum number of connections allowed.

Responses

Request samples

curl -X 'GET' \
  'https://api.dev.agent.guru/rs/v1/flights/offers?route=SAO,GIG,2026-02-01+GIG,SAO,2026-02-10&adts=1&chds=1&infs=0&provider_type=AZUL' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer mytoken'

Response samples

Content type
application/json
{
  • "flexible_recommendations": true,
  • "offers": [
    ]
}

/offers/price - Confirm if the chosen fare is still available.

Obtain a list of fares during a specified date interval.
The maximum period is 330 days.

Authorizations:
bearerAuth
query Parameters
slice_tokens
Array of strings

Specifies flight route as pipe-delimited string: origin|destination|outbound_date[+return_date]. Example: slice_token_1,slice_token_2

Responses

Request samples

curl -X 'GET' \
  'https://api.dev.agent.guru/rs/v1/flights/offers/price?slice_tokens=token_1,token_2' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer mytoken'

Response samples

Content type
application/json
{
  • "offer": {
    }
}

Booking

The Airline Booking Management API serves as a comprehensive solution for travel agencies to manage airline fares efficiently.
This API allows users to book flights from different sources like GDSs and Direct Connect providers.

/bookings - Create Booking

Authorizations:
bearerAuth
Request Body schema: application/json
required
selected_tokens
Array of strings

An array of selected token identifiers for the booking process.

Array of objects (Passenger)

A list of passengers included in the booking.

Responses

Request samples

Content type
application/json
{
  • "selected_tokens": [
    ],
  • "passengers": [
    ]
}

Response samples

Content type
application/json
{
  • "booking": {
    }
}

/bookings/{id} - Get Booking

Authorizations:
bearerAuth
path Parameters
id
required
string

The airline booking id. This is classified as a string because the airline ticket number consists of 13 characters, with the initial characters potentially being zeros, which must not be omitted.

Example: "0014995096800"

Responses

Request samples

curl -X 'GET' \
  'https://api.dev.agent.guru/rs/v1/flights/bookings/{booking_id}' \
  -H 'accept: application/json'

Response samples

Content type
application/json
{
  • "booking": {
    }
}

/bookings/{id} - Cancel Booking

Authorizations:
bearerAuth
path Parameters
id
required
string

The airline booking id. This is classified as a string because the airline ticket number consists of 13 characters, with the initial characters potentially being zeros, which must not be omitted.

Example: "0014995096800"

Responses

Request samples

curl -X 'DELETE' \
  'https://api.dev.agent.guru/rs/v1/flights/bookings/{booking_id}' \
  -H 'accept: application/json'

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

/bookings/{id} - Update Booking

Authorizations:
bearerAuth
path Parameters
id
required
string

The airline booking id. This is classified as a string because the airline ticket number consists of 13 characters, with the initial characters potentially being zeros, which must not be omitted.

Example: "0014995096800"

Request Body schema: application/json
required
required
Array of objects (BookingPassengerInfo)

Information about the passengers that need to be updated in the booking.

Responses

Request samples

Content type
application/json
{
  • "booking_passengers_info": [
    ]
}

Response samples

Content type
application/json
{
  • "booking": {
    }
}

Ticketing

The Airline Ticket Management API serves as a comprehensive solution for travel agencies to manage airline ticket efficiently.
This API allows users to search for tickets in a given period, paginate the results if the it is bigger than 250 items and also request information for a single ticket.

/tickets - Issue airline tickets

Authorizations:
bearerAuth
Request Body schema: application/json
required
booking_id
string
Array of objects (InputFormOfPayment)

Responses

Request samples

Content type
application/json
{
  • "booking_id": "string",
  • "form_of_payments": [
    ]
}

Response samples

Content type
application/json
{
  • "tickets": [
    ]
}

/tickets - Obtain tickets within a specified timeframe.

Obtain a list of tickets issued during a specified date interval.
The maximum period is 7 days.

Authorizations:
bearerAuth
query Parameters
start_date
string <date>

Specifies the start date of the period to search for ticketStatus.

Format: YYYY-MM-DD
Example: 2023-09-01
The default value is the current date.

end_date
string <date>

Specifies the end date of the period to search for tickets

Format: YYYY-MM-DD
Example: 2023-09-01
The default value is the current date.

page
integer <int32>

Specifies the page number for pagination of the search results.

Example: 1
The default value is 1

per_page
integer <int32>

Specifies the number of results to return per page for pagination.

Example: 50
The default value is set to its max limit of 250.

timezone
string

The timezone field allows the application to present date and time information in a way that is relevant to the client’s geographical location.

The default value is set to the Consolidator's timezone America/Sao_Paulo
Example values:

  • America/Sao_Paulo
  • America/New_York
  • Europe/Berlin
sort_by
string

Specifies the number of results to return per page for pagination
Additionally, they can be combined. Example: created_at,number

The default value is created_at.
Available fields for sorting:

  • id
  • number
  • validating_carrier
  • ticket_type
  • ticket_status
  • created_at
locator
string

The airline's reference for the booking, also known as a "passenger name record" (PNR) or "record locator".

Example: "BKJJ25"

Responses

Request samples

curl -X 'GET' \
  'https://api.dev.agent.guru/rs/v1/flights/tickets?start_date=2023-09-01&end_date=2023-09-11' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer mytoken'

Response samples

Content type
application/json
{
  • "tickets": [
    ],
  • "meta": {
    }
}

/tickets/{number} - Obtain a ticket by its number.

This method return a single ticket filtered by its number.

Authorizations:
bearerAuth
path Parameters
number
required
string

The airline ticket number. This is classified as a string because the airline ticket number consists of 13 characters, with the initial characters potentially being zeros, which must not be omitted.

Example: "0014995096800"

Responses

Request samples

curl -X 'GET' \
  'https://api.dev.agent.guru/rs/v1/flights/tickets/5774995096800 \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer mytoken'

Response samples

Content type
application/json
{
  • "number": "string",
  • "validating_carrier": "string",
  • "ticket_type": "TICKET",
  • "emd_type": "BAGGAGE",
  • "related_ticket_number": "string",
  • "flight_type": "DOMESTIC",
  • "ticket_status": "TICKETED",
  • "created_at": "string",
  • "cancelled_at": "2026-03-09T16:07:35Z",
  • "conjunctive_number": "string",
  • "original_ticket": "string",
  • "locator": "string",
  • "provider_type": "",
  • "backoffice_code": "string",
  • "created_by": {
    },
  • "airlines_locators": [
    ],
  • "price": {
    },
  • "passenger": {
    },
  • "slices": [
    ],
  • "form_of_payment": {
    },
  • "agency_profit": {
    }
}

/tickets/{number} - Cancel a ticket by its number.

This method cancel a single ticket filtered by its number.

Authorizations:
bearerAuth
path Parameters
number
required
string

The airline ticket number. This is classified as a string because the airline ticket number consists of 13 characters, with the initial characters potentially being zeros, which must not be omitted.

Example: "0014995096800"

Responses

Request samples

curl -X 'DELETE' \
  'https://api.dev.agent.guru/rs/v1/flights/tickets/5774995096800 \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer mytoken'

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}