# Flights

Create and store flight information for use with boarding passes. When creating boarding passes, you can reference a flight, automatically populating flight information on the pass. By storing and referencing flight information independently of your passes, you can update a single flight, automatically pushing an update to all passes referencing that flight.


## Add flight to a pass group {#addflighttopassgroup}

Add a flight to a pass group. You can target the group to make changes to multiple flights.

[Jump to examples ↓](#addflighttopassgroup-examples)

### `POST /flights/project/{projectId}/{flightId}/passGroups`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wfli

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `integer` | Required | The project that the flight belongs to. For [External IDs](/docs/developer/rest-api/wallet/introduction/#external-ids), format the `{projectId}` as `id/{projectExternalId}`.  |
| `flightId` | `integer` | Required | The flight you want modify groups for. For [External IDs](/docs/developer/rest-api/wallet/introduction/#external-ids), format the `{flightId}` as `id/{flightExternalId}`.  |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

**Content-Type:** `application/json`

- **`passGroups`** `array[string]`

  An array of pass groups that you want to create and add a flight to. If a pass group (string) in the array already exists, it is ignored.

**Responses**

**`200`** At least one pass group in the `passGroups` array was created.

Response body:

**Content-Type:** `application/json`

- **`flightId`** `integer`

  The Airship flight ID for the flight added to the pass group.

- **`passGroups`** `array[string]`

  An array of pass groups that the flight was added to.

**`400`** Missing or malformed input.

**`404`** The flight or project cannot be found.

**Examples**

*Example request*

```http
POST /v1/flights/project/12345/1234/passGroups HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
  "passGroups" :["sfo-pdx-20180730", "pdx-yvr-20180730"]
}

```

*Response*

```http
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "flightId" : 1234,
  "passGroups" :["sfo-pdx-20180730", "pdx-yvr-20180730"]
}

```

*Example request with external ID*

```http
POST /v1/flights/project/id/67890/id/4567/passGroups HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
  "passGroups" :["sfo-pdx-20180730", "pdx-yvr-20180730"]
}

```

*Response with external ID*

```http
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "flightExternalId" : "4567",
  "passGroups" :["sfo-pdx-20180730", "pdx-yvr-20180730"]
}

```

---

## Create flight {#createflight}

Create flights. See also [Create flight with external ID](#operation-flights-project-id-projectexternalid-id-flightexternalid-post).


[Jump to examples ↓](#createflight-examples)

### `POST /flights/project/{projectId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wfli

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `integer` | Required | The project you want to create the flight in. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

**Content-Type:** `application/json`

[Flight object]({{< ref "/developer/rest-api/wallet/schemas/flights-and-boarding-passes/" >}}#flightrequest)

**Responses**

**`200`** A successful request returns the `flightId` and `flightExternalId` (if applicable) values, so you can reference the flight in later operations.

Response body:

**Content-Type:** `application/json`

[Flight response]({{< ref "/developer/rest-api/wallet/schemas/flights-and-boarding-passes/" >}}#flightresponse)

**Examples**

*Example request*

```http
POST /v1/flights/project/12345 HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
  "passGroups": ["sfo-pdx-20250319"],
  "fields": {
    "flightNumber": { "value": "815" },
    "airlineCode": { "value": "OA" },
    "airlineName": { "value": "Sabine Airlines" },
    "departureAirport": {
      "label": "San Francisco",
      "value": "SFO"
    },
    "departureGate": {
      "label": "Gate #",
      "value": "25"
    },
    "boardingTime": { "value": "2025-03-19T20:30:00" },
    "departureTime": { "value": "2025-03-19T20:59" },
    "arrivalAirport": {
      "label": "Portland",
      "value": "PDX"
    },
    "arrivalTime": { "value": "2025-03-20T09:30:00" },
    "flightStatus": { "value": "scheduled" },
    "semantics" :{
          "airlineCode": "OA",
          "flightNumber": 2214,
          "originalBoardingDate": "2025-03-19T20:30:00-08:00",
          "originalDepartureDate": "2025-03-20T02:00:00-05:00",
          "originalArrivalDate": "2025-03-20T02:00:00-05:00",
          "currentBoardingDate": "2025-03-19T20:59:00-08:00",
          "currentDepartureDate": "2025-03-19T20:59:00-08:00",
          "currentArrivalDate": "2025-03-20T09:30:00-08:00",
          "departureAirportCode": "SFO",
          "departureCityName": "San Francisco",
          "departureLocationTimeZone": "America/Los_Angeles",
          "departureAirportLocation": {
               "latitude": 37.6191,
               "longitude": 122.3816
          },
         "departureGate": "25",
         "departureTerminal": "2",
         "destinationAirportCode": "PDX",
         "destinationCityName": "Portland",
         "destinationLocationTimeZone": "America/Los_Angeles",
         "destinationAirportLocation": {
              "latitude": 40.6446,
              "longitude": 73.7797
         },
         "destinationGate": "6",
         "destinationTerminal": "1"
   }
  }
}

```

*Response*

```http
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
  "flightId": 1234,
  "projectId": 12345,
  "createdAt": "2025-03-05T09:12:32Z",
  "updatedAt": "2025-03-05T09:12:32Z",
  "passGroups": ["sfo-pdx-20180730"],
  "fields": {
    "flightNumber": {
      "label": "Flight Number",
      "value": "815"
    },
    "airlineCode": {
      "label": "Airline Code",
      "value": "OA"
    },
    "airlineName": {
      "label": "Airline Name",
      "value": "Sabine Airlines"
    },
    "departureAirport": {
      "label": "San Francisco",
      "value": "SFO"
    },
    "departureGate": {
      "label": "Gate #",
      "value": "25"
    },
    "boardingTime": {
      "label": "Boarding Time",
      "value": "2025-03-19T20:30:00"
    },
    "departureTime": {
      "label": "Departure Time",
      "value": "2025-03-19T20:59:00"
    },
    "arrivalAirport": {
      "label": "Portland",
      "value": "PDX"
    },
    "arrivalGate": {
      "label": "Arrival Gate",
      "value": ""
    },
    "arrivalTime": {
      "label": "Arrival Time",
      "value": "2025-03-20T09:30:00"
    },
    "flightStatus": {
      "label": "Flight Status",
      "value": "scheduled"
    },
    "semantics" :{
          "airlineCode": "OA",
          "flightNumber": 2214,
          "originalBoardingDate": "2025-03-19T20:30:00-08:00",
          "originalDepartureDate": "2025-03-20T02:00:00-05:00",
          "originalArrivalDate": "2025-03-20T02:00:00-05:00",
          "currentBoardingDate": "2025-03-19T20:59:00-08:00",
          "currentDepartureDate": "2025-03-19T20:59:00-08:00",
          "currentArrivalDate": "2025-03-20T09:30:00-08:00",
          "departureAirportCode": "SFO",
          "departureCityName": "San Francisco",
          "departureLocationTimeZone": "America/Los_Angeles",
          "departureAirportLocation": {
               "latitude": 37.6191,
               "longitude": 122.3816
          },
         "departureGate": "25",
         "departureTerminal": "2",
         "destinationAirportCode": "PDX",
         "destinationCityName": "Portland",
         "destinationLocationTimeZone": "America/Los_Angeles",
         "destinationAirportLocation": {
              "latitude": 40.6446,
              "longitude": 73.7797
         },
         "destinationGate": "6",
         "destinationTerminal": "1"
   }
  }
}

```

---

## Create flight with external ID {#createflightexternalid}

Create flights with external ID. See also [Create flight](#operation-flights-project-projectid-post).


[Jump to examples ↓](#createflightexternalid-examples)

### `POST /flights/project/id/{projectExternalId}/id/{flightExternalId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wfli

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectExternalId` | `string` | Required | The project you want to create the flight in. |
| `flightExternalId` | `string` | Required | The external identifier you want to give to the flight. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

**Content-Type:** `application/json`

[Flight object]({{< ref "/developer/rest-api/wallet/schemas/flights-and-boarding-passes/" >}}#flightrequest)

**Responses**

**`200`** A successful request returns the `flightId` and `flightExternalId` (if applicable) values, so you can reference the flight in later operations.

Response body:

**Content-Type:** `application/json`

[Flight response]({{< ref "/developer/rest-api/wallet/schemas/flights-and-boarding-passes/" >}}#flightresponse)

**Examples**

*Example request*

```http
POST /v1/flights/project/id/project123ExtId/id/flight123ExtId HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
  "passGroups": ["sfo-pdx-20180730"],
  "fields": {
    "flightNumber": { "value": "815" },
    "airlineCode": { "value": "OA" },
    "airlineName": { "value": "Sabine Airlines" },
    "departureAirport": {
      "label": "San Francisco",
      "value": "SFO"
    },
    "departureGate": {
      "label": "Gate #",
      "value": "25"
    },
    "boardingTime": { "value": "2018-07-30T08:35:00" },
    "departureTime": { "value": "2018-07-30T09:00:00" },
    "arrivalAirport": {
      "label": "Portland",
      "value": "PDX"
    },
    "arrivalTime": { "value": "2018-07-30T11:00:00" },
    "flightStatus": { "value": "scheduled" }
  }
}

```

*Response*

```http
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
  "flightId": 1234,
  "flightExternalId": "flight123ExtId",
  "projectId": 12345,
  "projectExternalId": "project123ExtId",
  "createdAt": "2018-07-05T09:12:32Z",
  "updatedAt": "2018-07-05T09:12:32Z",
  "passGroups": ["sfo-pdx-20180730"],
  "fields": {
    "flightNumber": {
      "label": "Flight Number",
      "value": "815"
    },
    "airlineCode": {
      "label": "Airline Code",
      "value": "OA"
    },
    "airlineName": {
      "label": "Airline Name",
      "value": "Sabine Airlines"
    },
    "departureAirport": {
      "label": "San Francisco",
      "value": "SFO"
    },
    "departureGate": {
      "label": "Gate #",
      "value": "25"
    },
    "boardingTime": {
      "label": "Boarding Time",
      "value": "2018-07-30T08:35:00"
    },
    "departureTime": {
      "label": "Departure Time",
      "value": "2018-07-30T09:00:00"
    },
    "arrivalAirport": {
      "label": "Portland",
      "value": "PDX"
    },
    "arrivalGate": {
      "label": "Arrival Gate",
      "value": ""
    },
    "arrivalTime": {
      "label": "Arrival Time",
      "value": "2018-07-30T11:00:00"
    },
    "flightStatus": {
      "label": "Flight Status",
      "value": "scheduled"
    }
  }
}

```

---

## Delete flight {#deleteflight}

Deletes the specified flight.

[Jump to examples ↓](#deleteflight-examples)

### `DELETE /flights/project/{projectId}/{flightId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wfli

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `integer` | Required | The project that the flight belongs to. For [External IDs](/docs/developer/rest-api/wallet/introduction/#external-ids), format the `{projectId}` as `id/{projectExternalId}`. |
| `flightId` | `integer` | Required | The flight you want to get, update, or delete. For [External IDs](/docs/developer/rest-api/wallet/introduction/#external-ids), format the `{flightId}` as `id/{flightExternalId}`. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** The flight was deleted.

Response body:

**Content-Type:** `application/json`

- **`ok`** `boolean`

  If true, the operation completed successfully.

**Examples**

*Example request*

```http
DELETE /v1/flights/project/12345/1234 HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2

```

*Example request with external ID*

```http
DELETE /v1/flights/project/id/project123ExtId/id/flight123ExtId HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2

```

*Response*

```http
HTTP/1.1 200 OK

```

---

## Get flight {#getflight}

Returns information for a single flight.

[Jump to examples ↓](#getflight-examples)

### `GET /flights/project/{projectId}/{flightId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wfli

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `integer` | Required | The project that the flight belongs to. For [External IDs](/docs/developer/rest-api/wallet/introduction/#external-ids), format the `{projectId}` as `id/{projectExternalId}`. |
| `flightId` | `integer` | Required | The flight you want to get, update, or delete. For [External IDs](/docs/developer/rest-api/wallet/introduction/#external-ids), format the `{flightId}` as `id/{flightExternalId}`. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** A successful request returns the `flightId` and `flightExternalId` (if applicable) values, so you can reference the flight in later operations.

Response body:

**Content-Type:** `application/json`

[Flight response]({{< ref "/developer/rest-api/wallet/schemas/flights-and-boarding-passes/" >}}#flightresponse)

**Examples**

*Example request*

```http
GET /v1/flights/project/12345/1234 HTTP/1.1
Authorization: Basic <authorization string>

```

*Response*

```http
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "flightId": 1234,
  "projectId": 12345,
  "createdAt": "2018-07-05T09:12:32Z",
  "updatedAt": "2018-07-05T09:12:32Z",
  "passGroups": ["sfo-pdx-20180730"],
  "fields": {
    "flightNumber": {
      "label": "Flight Number",
      "value": "815"
    },
    "airlineCode": {
      "label": "Airline Code",
      "value": "OA"
    },
    "airlineName": {
      "label": "Airline Name",
      "value": "Sabine Airlines"
    },
    "departureAirport": {
      "label": "San Francisco",
      "value": "SFO"
    },
    "departureGate": {
      "label": "Gate #",
      "value": "21"
    },
    "boardingTime": {
      "label": "Boarding Time",
      "value": "2025-03-19T20:30:00"
    },
    "departureTime": {
      "label": "Departure Time",
      "value": "2025-03-20T02:00:00"
    },
    "arrivalAirport": {
      "label": "Portland",
      "value": "PDX"
    },
    "arrivalGate": {
      "label": "Arrival Gate",
      "value": ""
    },
    "arrivalTime": {
      "label": "Arrival Time",
      "value": "2025-03-20T02:00:00"
    },
    "flightStatus": {
      "label": "Flight Status",
      "value": "scheduled"
    },
    "semantics" :{
          "airlineCode": "OA",
          "flightNumber": 2214,
          "originalBoardingDate": "2025-03-19T20:30:00-08:00",
          "originalDepartureDate": "2025-03-20T02:00:00-05:00",
          "originalArrivalDate": "2025-03-20T02:00:00-05:00",
          "currentBoardingDate": "2025-03-19T20:59:00-08:00",
          "currentDepartureDate": "2025-03-19T20:59:00-08:00",
          "currentArrivalDate": "2025-03-20T09:30:00-08:00",
          "departureAirportCode": "SFO",
          "departureCityName": "San Francisco",
          "departureLocationTimeZone": "America/Los_Angeles",
          "departureAirportLocation": {
               "latitude": 37.6191,
               "longitude": 122.3816
          },
         "departureGate": "25",
         "departureTerminal": "2",
         "destinationAirportCode": "PDX",
         "destinationCityName": "Portland",
         "destinationLocationTimeZone": "America/Los_Angeles",
         "destinationAirportLocation": {
              "latitude": 40.6446,
              "longitude": 73.7797
         },
         "destinationGate": "6",
         "destinationTerminal": "1"
   }
  }
}

```

*Example request with external ID*

```http
GET /v1/flights/project/id/project123ExtId/id/flight123ExtId HTTP/1.1
Authorization: Basic <authorization string>

```

*Response with external ID*

```http
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "flightId": 1234,
  "flightExternalId": "flight123ExtId",
  "projectId": 12345,
  "projectExternalId": "project123ExtId",
  "createdAt": "2018-07-05T09:12:32Z",
  "updatedAt": "2018-07-05T09:12:32Z",
  "passGroups": ["sfo-pdx-20180730"],
  "fields": {
    "flightNumber": {
      "label": "Flight Number",
      "value": "815"
    },
    "airlineCode": {
      "label": "Airline Code",
      "value": "OA"
    },
    "airlineName": {
      "label": "Airline Name",
      "value": "Sabine Airlines"
    },
    "departureAirport": {
      "label": "San Francisco",
      "value": "SFO"
    },
    "departureGate": {
      "label": "Gate #",
      "value": "21"
    },
    "boardingTime": {
      "label": "Boarding Time",
      "value": "2018-07-30T09:20:00"
    },
    "departureTime": {
      "label": "Departure Time",
      "value": "2018-07-30T09:45:00"
    },
    "arrivalAirport": {
      "label": "Portland",
      "value": "PDX"
    },
    "arrivalGate": {
      "label": "Arrival Gate",
      "value": ""
    },
    "arrivalTime": {
      "label": "Arrival Time",
      "value": "2018-07-30T11:45:00"
    },
    "flightStatus": {
      "label": "Flight Status",
      "value": "scheduled"
    }
  }
}

```

---

## List pass groups for a flight {#listpassgroupsforflight}

Returns a list of pass groups associated with a flight.

[Jump to examples ↓](#listpassgroupsforflight-examples)

### `GET /flights/project/{projectId}/{flightId}/passGroups`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wfli

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `integer` | Required | The project that the flight belongs to. For [External IDs](/docs/developer/rest-api/wallet/introduction/#external-ids), format the `{projectId}` as `id/{projectExternalId}`.  |
| `flightId` | `integer` | Required | The flight you want modify groups for. For [External IDs](/docs/developer/rest-api/wallet/introduction/#external-ids), format the `{flightId}` as `id/{flightExternalId}`.  |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** Returns a list of pass groups that a flight is associated with.

Response body:

**Content-Type:** `application/json`

- **`flightId`** `integer`

  The ID of the flight in the request.

- **`passGroups`** `array[string]`

  An array of the pass groups that the flight belongs to.

**`400`** Missing fields or malformed input.

**`404`** The flight or project cannot be found.

**Examples**

*Example request*

```http
GET /v1/flights/project/12345/1234/passGroups HTTP/1.1
Authorization: Basic <authorization string>

```

*Response*

```http
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8 

{
  "flightId" : 1234,
  "passGroups" :["sfo-pdx-20180730", "pdx-yvr-20180730"]
}

```

*Example request with external ID*

```http
GET /v1/flights/project/id/67890/id/4567/passGroups HTTP/1.1
Authorization: Basic <authorization string>

```

*Response with external ID*

```http
HTTP/1.1 200 OK 
Content-Type: application/json; charset=utf-8 

{
  "flightExternalId" : 4567,
  "passGroups" :["sfo-pdx-20180730", "pdx-yvr-20180730"]
}

```

---

## Remove flight from pass group {#removeflightfrompassgroup}

Removes a flight from a pass group. The group specified in the path will no longer appear in the flight's `passGroups` array, nor will you be able to make changes to the flight by targeting the pass group.

[Jump to examples ↓](#removeflightfrompassgroup-examples)

### `DELETE /flights/project/{projectId}/{flightId}/passGroups/{passGroup}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wfli

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `integer` | Required | The project that the flight belongs to. Use either the Airship-generated project ID or the external ID. For [External IDs](/docs/developer/rest-api/wallet/introduction/#external-ids), format the `{projectId}` as `id/{projectExternalId}`.  |
| `flightId` | `integer` | Required | The flight you want modify groups for. Use either the Airship-generated flight ID or the external ID for the flight. For [External IDs](/docs/developer/rest-api/wallet/introduction/#external-ids), format the `{flightId}` as `id/{flightExternalId}`.  |
| `passGroup` | `string` | Required | The pass group you want to remove the flight from. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** The flight was successfully removed from the pass group.

**`400`** The project, flight, or pass group was not found.

**Examples**

*Example request*

```http
DELETE /v1/flights/project/12345/1234/passGroups/sfo-pdx-20180730 HTTP/1.1
Authorization: Basic <authorization string>

```

*Example request with external ID*

```http
DELETE /v1/flights/project/id/67890/id/4567/passGroups/sfo-pdx-20180730 HTTP/1.1
Authorization: Basic <authorization string>

```

---

## Update flight {#updateflight}

Update any of the keys provided in the `fields` object of a [Flight Request](/docs/developer/rest-api/wallet/schemas/flights-and-boarding-passes/#flightrequest). Provide only the fields you want to update; any fields that you omit from the payload remain unchanged.


[Jump to examples ↓](#updateflight-examples)

### `PUT /flights/project/{projectId}/{flightId}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wfli

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `integer` | Required | The project that the flight belongs to. For [External IDs](/docs/developer/rest-api/wallet/introduction/#external-ids), format the `{projectId}` as `id/{projectExternalId}`. |
| `flightId` | `integer` | Required | The flight you want to get, update, or delete. For [External IDs](/docs/developer/rest-api/wallet/introduction/#external-ids), format the `{flightId}` as `id/{flightExternalId}`. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

**Content-Type:** `application/json`

[Flight object]({{< ref "/developer/rest-api/wallet/schemas/flights-and-boarding-passes/" >}}#flightrequest)

**Responses**

**`200`** A successful request returns the complete, updated flight object and the `flightId` and `flightExternalId` (if applicable) values, so you can reference the updated flight in later operations.

Response body:

**Content-Type:** `application/json`

[Flight response]({{< ref "/developer/rest-api/wallet/schemas/flights-and-boarding-passes/" >}}#flightresponse)

**Examples**

*Example request*

```http
PUT /v1/flights/project/12345/1234 HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
  "passGroups": ["sfo-pdx-20180730"],
  "fields": {
    "departureGate": { "value": "21" },
    "boardingTime": { "value": "2018-07-30T09:20:00" },
    "departureTime": { "value": "2018-07-30T09:45:00" },
    "arrivalTime": { "value": "2018-07-30T11:45:00" }
  }
}

```

*Response*

```http
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "flightId": 1234,
  "projectId": 12345,
  "createdAt": "2018-07-05T09:12:32Z",
  "updatedAt": "2018-07-05T09:15:32Z",
  "passGroups": ["sfo-pdx-20180730"],
  "fields": {
    "flightNumber": {
      "label": "Flight Number",
      "value": "815"
    },
    "airlineCode": {
      "label": "Airline Code",
      "value": "OA"
    },
    "airlineName": {
      "label": "Airline Name",
      "value": "Sabine Airlines"
    },
    "departureAirport": {
      "label": "San Francisco",
      "value": "SFO"
    },
    "departureGate": {
      "label": "Gate #",
      "value": "21"
    },
    "boardingTime": {
      "label": "Boarding Time",
      "value": "2018-07-30T09:20:00"
    },
    "departureTime": {
      "label": "Departure Time",
      "value": "2018-07-30T09:45:00"
    },
    "arrivalAirport": {
      "label": "Portland",
      "value": "PDX"
    },
    "arrivalGate": {
      "label": "Arrival Gate",
      "value": ""
    },
    "arrivalTime": {
      "label": "Arrival Time",
      "value": "2018-07-30T11:45:00"
    },
    "flightStatus": {
      "label": "Flight Status",
      "value": "scheduled"
    }
  }
}

```

*Example request with external ID*

```http
PUT /v1/flights/project/id/project123ExtId/id/flight123ExtId HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
  "passGroups": ["sfo-pdx-20180730"],
  "fields": {
    "departureGate": { "value": "21" },
    "boardingTime": { "value": "2018-07-30T09:20:00" },
    "departureTime": { "value": "2018-07-30T09:45:00" },
    "arrivalTime": { "value": "2018-07-30T11:45:00" }
  }
}

```

*Response with external ID*

```http
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "flightId": 1234,
  "flightExternalId": "flight123ExtId",
  "projectId": 12345,
  "projectExternalId": "project123ExtId",
  "createdAt": "2018-07-05T09:12:32Z",
  "updatedAt": "2018-07-05T09:15:32Z",
  "passGroups": ["sfo-pdx-20180730"],
  "fields": {
    "flightNumber": {
      "label": "Flight Number",
      "value": "815"
    },
    "airlineCode": {
      "label": "Airline Code",
      "value": "OA"
    },
    "airlineName": {
      "label": "Airline Name",
      "value": "Sabine Airlines"
    },
    "departureAirport": {
      "label": "San Francisco",
      "value": "SFO"
    },
    "departureGate": {
      "label": "Gate #",
      "value": "21"
    },
    "boardingTime": {
      "label": "Boarding Time",
      "value": "2018-07-30T09:20:00"
    },
    "departureTime": {
      "label": "Departure Time",
      "value": "2018-07-30T09:45:00"
    },
    "arrivalAirport": {
      "label": "Portland",
      "value": "PDX"
    },
    "arrivalGate": {
      "label": "Arrival Gate",
      "value": ""
    },
    "arrivalTime": {
      "label": "Arrival Time",
      "value": "2018-07-30T11:45:00"
    },
    "flightStatus": {
      "label": "Flight Status",
      "value": "scheduled"
    }
  }
}

```

---

## Update flights in a pass group {#updateflightsinpassgroup}

Update all of the flights in a pass group. See also [Update flights with external ID in a pass group](#operation-flights-project-id-projectexternalid-id-passgroups-passgroup-put).


[Jump to examples ↓](#updateflightsinpassgroup-examples)

### `PUT /flights/project/{projectId}/passGroups/{passGroup}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wfli

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `integer` | Required | The project that the flight belongs to. Use either the Airship-generated project ID or the external ID.  |
| `passGroup` | `integer` | Required | The pass group that you want to modify. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

Update fields common to a group of flights.


**Content-Type:** `application/json`

- **`fields`** `object`

  Provide only the keys that you want to update from `fields` object of an [flight Request](/docs/developer/rest-api/wallet/schemas/flights-and-boarding-passes/#flightrequest); any fields that you omit from the payload remain unchanged.

**Responses**

**`200`** The update was successful.

Response body:

**Content-Type:** `application/json`

- **`flights`** `array[object]`

  Lists the flights updated as a part of this pass group.

- **`groupName`** `string`

  The pass group that you updated in this request.

**`400`** The request was malformed.

**`404`** The project ID or pass group was not found.

**Examples**

*Example request*

```http
PUT /v1/flights/project/12345/passGroups/sfo-pdx-20180730 HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
  "fields": {
    "departureTime": {
      "value": "2018-08-30T10:00:00"
    }
  }
}

```

*Response*

```http
HTTP/1.1 200 OK 
Content-Type: application/json; charset=utf-8 

{
  "groupName" : "sfo-pdx-20180730", 
  "flights" : [
    {
      "flightId" : 123
    },
    {
      "flightId" : 456
    }
  ]
}

```

---

## Update flights with external ID in a pass group {#updateflightsinpassgroupexternalid}

Update fields common to a group of flights. Provide only the keys that you want to update from `fields` object of an [flight Request](/docs/developer/rest-api/wallet/schemas/flights-and-boarding-passes/#flightrequest); any fields that you omit from the payload remain unchanged.
See also [Update flights in a pass group](#operation-flights-project-projectid-passgroups-passgroup-put).


[Jump to examples ↓](#updateflightsinpassgroupexternalid-examples)

### `PUT /flights/project/id/{projectExternalId}/id/passGroups/{passGroup}`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)
- [oauth2Token]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-oauth2Token): wfli

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectExternalId` | `string` | Required | The project that the flight belongs to.  |
| `passGroup` | `string` | Required | The pass group that you want to modify. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

Provide only the field(s) you want to update for all of the flights in the group.

**Content-Type:** `application/json`

- **`fields`** `object`

  Provide only the keys that you want to update from `fields` object of an [flight Request](/docs/developer/rest-api/wallet/schemas/flights-and-boarding-passes/#flightrequest); any fields that you omit from the payload remain unchanged.

**Responses**

**`200`** The update was successful.

Response body:

**Content-Type:** `application/json`

- **`flights`** `array[object]`

  Lists the flights updated as a part of this pass group.

- **`groupName`** `string`

  The pass group that you updated in this request.

**`400`** The request was malformed.

**`404`** The project ID or pass group was not found.

**Examples**

*Example request*

```http
PUT /v1/flights/project/id/project123ExtId/id/passGroups/sfo-pdx-20180730 HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json

{
  "fields": {
    "departureTime": {
      "value": "2018-08-30T10:00:00"
    }
  }
}

```

*Response*

```http
HTTP/1.1 200 OK 
Content-Type: application/json; charset=utf-8 

{
  "groupName" : "sfo-pdx-20180730", 
  "flights" : [
    {
      "flightId" : 123
    },
    {
      "flightId" : 456
    }
  ]
}

```

---

