# Activity

An activity is an event that has happened to a contact, such as a booking, purchase, or interaction. Activities track the history of a contact and can trigger automations or workflows. Each activity is associated with a contact and has a type, source, and date. Some activities may also have a booking, order, or gift card associated with them.

## List all activities

> Returns a list of activities across all contacts. The activities are ordered by the date they happened, with the most recent first.

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Activity","description":"An activity is an event that has happened to a contact, such as a booking, purchase, or interaction. Activities track the history of a contact and can trigger automations or workflows. Each activity is associated with a contact and has a type, source, and date. Some activities may also have a booking, order, or gift card associated with them."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Activity-activity.read":{"type":"object","description":"An activity is an event that has happened to a contact, such as a booking, purchase, or interaction. Activities track the history of a contact and can trigger automations or workflows. Each activity is associated with a contact and has a type, source, and date. Some activities may also have a booking, order, or gift card associated with them.","properties":{"id":{"readOnly":true,"type":"integer"},"contact":{"type":"integer"},"happenedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["Booking","Checked in","Checked out","Purchase","Shopify order","Golf reservation","Table reservation","Gift card registered","Added gift card to Apple Wallet","Viewed partner offer","Clicked partner offer link","Added partner offer to Apple wallet","Added partner offer to Google wallet","Membership started","Changed tier","Membership cancelled","Added membership card to Apple Wallet","Login","Connected to wifi","Contact merged in","Referral invite created","Referral invite completed"]},"source":{"type":"string"},"booking":{"anyOf":[{"$ref":"#/components/schemas/Booking-activity.read"},{"type":"null"}]},"externalReference":{"type":["string","null"]},"purchase":{"type":["string","null"],"format":"iri-reference"},"spend":{"description":"The amount of money spent, in the smallest currency unit. For example 100 would be equal to £1.00.","default":0,"type":"integer"},"giftCard":{"type":["string","null"],"format":"iri-reference"},"currencyCode":{"type":["string","null"]},"referralInvite":{"type":["string","null"],"format":"iri-reference"},"golfReservation":{"anyOf":[{"$ref":"#/components/schemas/Golf.reservation-activity.read"},{"type":"null"}]},"tableReservation":{"anyOf":[{"$ref":"#/components/schemas/Table.reservation-activity.read"},{"type":"null"}]}}},"Booking-activity.read":{"type":"object","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"numberOfGuests":{"type":"integer"},"roomType":{"type":["string","null"]},"roomName":{"type":["string","null"]},"externalReference":{"type":["string","null"]},"total":{"type":"integer"},"currencyCode":{"type":"string"},"customerReference":{"type":"string"},"purpose":{"type":"string"},"channelNumber":{"type":["string","null"]},"origin":{"type":"string"},"direct":{"default":false,"type":"boolean"},"status":{"type":"string","enum":["Inquired","Confirmed","Started","Processed","Canceled","Optional","Requested"]}}},"Golf.reservation-activity.read":{"type":"object","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"holes":{"type":"integer"},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"origin":{"description":"The source of the golf reservation, e.g. the booking system or channel through which it was made.","type":"string"},"originReference":{"description":"The ID or reference in the origin platform of the golf reservation, e.g. the booking system or channel reference.","default":"","type":"string"},"customerBookingReference":{"description":"The reference given to the customer for the golf reservation.","default":"","type":"string"},"cancelledAt":{"type":["string","null"],"format":"date-time"},"courseId":{"default":"","type":"string"},"courseName":{"default":"","type":"string"}}},"Table.reservation-activity.read":{"type":"object","description":"Represents a dining reservation made by a contact with details about the reservation, such as the party size, status, and any notes.","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"notes":{"type":"string"},"partySize":{"type":"integer"},"status":{"type":"string"},"origin":{"type":"string"},"originReference":{"type":"string"},"customerBookingReference":{"type":"string"},"cancelledAt":{"type":["string","null"],"format":"date-time"}}},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}}}},"paths":{"/activities":{"get":{"operationId":"api_activities_get_collection","tags":["Activity"],"responses":{"200":{"description":"Activity collection","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Activity-activity.read"}}}}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}}},"summary":"List all activities","description":"Returns a list of activities across all contacts. The activities are ordered by the date they happened, with the most recent first.","parameters":[{"name":"page","in":"query","description":"The collection page number","required":false,"deprecated":false,"schema":{"type":"integer","default":1},"style":"form","explode":true},{"name":"happenedAt[before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"happenedAt[strictly_before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"happenedAt[after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"happenedAt[strictly_after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"createdAt[before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"createdAt[strictly_before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"createdAt[after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"createdAt[strictly_after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"updatedAt[before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"updatedAt[strictly_before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"updatedAt[after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"updatedAt[strictly_after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"type","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string","enum":["Booking","Checked in","Checked out","Purchase","Shopify order","Golf reservation","Table reservation","Gift card registered","Added gift card to Apple Wallet","Viewed partner offer","Clicked partner offer link","Added partner offer to Apple wallet","Added partner offer to Google wallet","Membership started","Changed tier","Membership cancelled","Added membership card to Apple Wallet","Login","Connected to wifi","Contact merged in","Referral invite created","Referral invite completed"]},"style":"form","explode":false},{"name":"type[]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"array","items":{"type":"string","enum":["Booking","Checked in","Checked out","Purchase","Shopify order","Golf reservation","Table reservation","Gift card registered","Added gift card to Apple Wallet","Viewed partner offer","Clicked partner offer link","Added partner offer to Apple wallet","Added partner offer to Google wallet","Membership started","Changed tier","Membership cancelled","Added membership card to Apple Wallet","Login","Connected to wifi","Contact merged in","Referral invite created","Referral invite completed"]}},"style":"form","explode":true}]}}}}
```

## Create an activity

> Creates a new activity for a contact. The activity type determines what kind of event is being recorded. For bookings, include an embedded booking object with check-in/check-out dates, room details, and total. For purchases, include the spend amount and currency code.

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Activity","description":"An activity is an event that has happened to a contact, such as a booking, purchase, or interaction. Activities track the history of a contact and can trigger automations or workflows. Each activity is associated with a contact and has a type, source, and date. Some activities may also have a booking, order, or gift card associated with them."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Activity-activity.read":{"type":"object","description":"An activity is an event that has happened to a contact, such as a booking, purchase, or interaction. Activities track the history of a contact and can trigger automations or workflows. Each activity is associated with a contact and has a type, source, and date. Some activities may also have a booking, order, or gift card associated with them.","properties":{"id":{"readOnly":true,"type":"integer"},"contact":{"type":"integer"},"happenedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["Booking","Checked in","Checked out","Purchase","Shopify order","Golf reservation","Table reservation","Gift card registered","Added gift card to Apple Wallet","Viewed partner offer","Clicked partner offer link","Added partner offer to Apple wallet","Added partner offer to Google wallet","Membership started","Changed tier","Membership cancelled","Added membership card to Apple Wallet","Login","Connected to wifi","Contact merged in","Referral invite created","Referral invite completed"]},"source":{"type":"string"},"booking":{"anyOf":[{"$ref":"#/components/schemas/Booking-activity.read"},{"type":"null"}]},"externalReference":{"type":["string","null"]},"purchase":{"type":["string","null"],"format":"iri-reference"},"spend":{"description":"The amount of money spent, in the smallest currency unit. For example 100 would be equal to £1.00.","default":0,"type":"integer"},"giftCard":{"type":["string","null"],"format":"iri-reference"},"currencyCode":{"type":["string","null"]},"referralInvite":{"type":["string","null"],"format":"iri-reference"},"golfReservation":{"anyOf":[{"$ref":"#/components/schemas/Golf.reservation-activity.read"},{"type":"null"}]},"tableReservation":{"anyOf":[{"$ref":"#/components/schemas/Table.reservation-activity.read"},{"type":"null"}]}}},"Booking-activity.read":{"type":"object","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"numberOfGuests":{"type":"integer"},"roomType":{"type":["string","null"]},"roomName":{"type":["string","null"]},"externalReference":{"type":["string","null"]},"total":{"type":"integer"},"currencyCode":{"type":"string"},"customerReference":{"type":"string"},"purpose":{"type":"string"},"channelNumber":{"type":["string","null"]},"origin":{"type":"string"},"direct":{"default":false,"type":"boolean"},"status":{"type":"string","enum":["Inquired","Confirmed","Started","Processed","Canceled","Optional","Requested"]}}},"Golf.reservation-activity.read":{"type":"object","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"holes":{"type":"integer"},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"origin":{"description":"The source of the golf reservation, e.g. the booking system or channel through which it was made.","type":"string"},"originReference":{"description":"The ID or reference in the origin platform of the golf reservation, e.g. the booking system or channel reference.","default":"","type":"string"},"customerBookingReference":{"description":"The reference given to the customer for the golf reservation.","default":"","type":"string"},"cancelledAt":{"type":["string","null"],"format":"date-time"},"courseId":{"default":"","type":"string"},"courseName":{"default":"","type":"string"}}},"Table.reservation-activity.read":{"type":"object","description":"Represents a dining reservation made by a contact with details about the reservation, such as the party size, status, and any notes.","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"notes":{"type":"string"},"partySize":{"type":"integer"},"status":{"type":"string"},"origin":{"type":"string"},"originReference":{"type":"string"},"customerBookingReference":{"type":"string"},"cancelledAt":{"type":["string","null"],"format":"date-time"}}},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}},"ConstraintViolation.jsonld":{"type":"object","description":"Unprocessable entity","properties":{"status":{"default":422,"type":"integer"},"violations":{"type":"array","items":{"type":"object","properties":{"propertyPath":{"type":"string","description":"The property path of the violation"},"message":{"type":"string","description":"The message associated with the violation"},"code":{"type":"string","description":"The code of the violation"},"hint":{"type":"string","description":"An extra hint to understand the violation"},"payload":{"type":"object","additionalProperties":true,"description":"The serialized payload of the violation"}},"required":["propertyPath","message"]}},"detail":{"readOnly":true,"type":"string"},"description":{"readOnly":true,"type":"string"},"type":{"readOnly":true,"type":"string"},"title":{"readOnly":true,"type":["string","null"]},"instance":{"readOnly":true,"type":["string","null"]}}},"ConstraintViolation":{"type":"object","description":"Unprocessable entity","properties":{"status":{"default":422,"type":"integer"},"violations":{"type":"array","items":{"type":"object","properties":{"propertyPath":{"type":"string","description":"The property path of the violation"},"message":{"type":"string","description":"The message associated with the violation"},"code":{"type":"string","description":"The code of the violation"},"hint":{"type":"string","description":"An extra hint to understand the violation"},"payload":{"type":"object","additionalProperties":true,"description":"The serialized payload of the violation"}},"required":["propertyPath","message"]}},"detail":{"readOnly":true,"type":"string"},"type":{"readOnly":true,"type":"string"},"title":{"readOnly":true,"type":["string","null"]},"instance":{"readOnly":true,"type":["string","null"]}}},"Activity-activity.write":{"type":"object","description":"An activity is an event that has happened to a contact, such as a booking, purchase, or interaction. Activities track the history of a contact and can trigger automations or workflows. Each activity is associated with a contact and has a type, source, and date. Some activities may also have a booking, order, or gift card associated with them.","properties":{"id":{"readOnly":true,"type":"integer"},"contact":{"type":"integer"},"happenedAt":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["Booking","Checked in","Checked out","Purchase","Shopify order","Golf reservation","Table reservation","Gift card registered","Added gift card to Apple Wallet","Viewed partner offer","Clicked partner offer link","Added partner offer to Apple wallet","Added partner offer to Google wallet","Membership started","Changed tier","Membership cancelled","Added membership card to Apple Wallet","Login","Connected to wifi","Contact merged in","Referral invite created","Referral invite completed"]},"source":{"type":"string"},"booking":{"anyOf":[{"$ref":"#/components/schemas/Booking-activity.write"},{"type":"null"}]},"externalReference":{"type":["string","null"]},"purchase":{"type":["string","null"],"format":"iri-reference"},"spend":{"description":"The amount of money spent, in the smallest currency unit. For example 100 would be equal to £1.00.","default":0,"type":"integer"},"giftCard":{"type":["string","null"],"format":"iri-reference"},"currencyCode":{"type":["string","null"]},"referralInvite":{"type":["string","null"],"format":"iri-reference"},"golfReservation":{"anyOf":[{"$ref":"#/components/schemas/Golf.reservation-activity.write"},{"type":"null"}]},"tableReservation":{"anyOf":[{"$ref":"#/components/schemas/Table.reservation-activity.write"},{"type":"null"}]}}},"Booking-activity.write":{"type":"object","description":"A booking, sometimes called a reservation, is a stay associated with a contact.","properties":{"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"numberOfGuests":{"type":"integer"},"roomType":{"type":["string","null"]},"roomName":{"type":["string","null"]},"externalReference":{"type":["string","null"]},"total":{"type":"integer"},"currencyCode":{"type":"string"},"customerReference":{"type":"string"},"purpose":{"type":"string"},"channelNumber":{"type":["string","null"]},"origin":{"type":"string"},"direct":{"default":false,"type":"boolean"},"status":{"type":"string","enum":["Inquired","Confirmed","Started","Processed","Canceled","Optional","Requested"]}}},"Golf.reservation-activity.write":{"type":"object","properties":{"holes":{"type":"integer"},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"origin":{"description":"The source of the golf reservation, e.g. the booking system or channel through which it was made.","type":"string"},"originReference":{"description":"The ID or reference in the origin platform of the golf reservation, e.g. the booking system or channel reference.","default":"","type":"string"},"customerBookingReference":{"description":"The reference given to the customer for the golf reservation.","default":"","type":"string"},"cancelledAt":{"type":["string","null"],"format":"date-time"},"courseId":{"default":"","type":"string"},"courseName":{"default":"","type":"string"}}},"Table.reservation-activity.write":{"type":"object","description":"Represents a dining reservation made by a contact with details about the reservation, such as the party size, status, and any notes.","properties":{"notes":{"type":"string"},"partySize":{"type":"integer"},"status":{"type":"string"},"origin":{"type":"string"},"originReference":{"type":"string"},"customerBookingReference":{"type":"string"},"cancelledAt":{"type":["string","null"],"format":"date-time"}}}}},"paths":{"/activities":{"post":{"operationId":"api_activities_post","tags":["Activity"],"responses":{"201":{"description":"Activity resource created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Activity-activity.read"}}},"links":{}},"400":{"description":"Invalid input","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"422":{"description":"An error occurred","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/ConstraintViolation.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ConstraintViolation"}},"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolation"}}},"links":{}}},"summary":"Create an activity","description":"Creates a new activity for a contact. The activity type determines what kind of event is being recorded. For bookings, include an embedded booking object with check-in/check-out dates, room details, and total. For purchases, include the spend amount and currency code.","parameters":[],"requestBody":{"description":"The new Activity resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Activity-activity.write"}}},"required":true}}}}}
```

## Retrieve an activity

> Retrieve an activity

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Activity","description":"An activity is an event that has happened to a contact, such as a booking, purchase, or interaction. Activities track the history of a contact and can trigger automations or workflows. Each activity is associated with a contact and has a type, source, and date. Some activities may also have a booking, order, or gift card associated with them."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Activity-activity.read":{"type":"object","description":"An activity is an event that has happened to a contact, such as a booking, purchase, or interaction. Activities track the history of a contact and can trigger automations or workflows. Each activity is associated with a contact and has a type, source, and date. Some activities may also have a booking, order, or gift card associated with them.","properties":{"id":{"readOnly":true,"type":"integer"},"contact":{"type":"integer"},"happenedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["Booking","Checked in","Checked out","Purchase","Shopify order","Golf reservation","Table reservation","Gift card registered","Added gift card to Apple Wallet","Viewed partner offer","Clicked partner offer link","Added partner offer to Apple wallet","Added partner offer to Google wallet","Membership started","Changed tier","Membership cancelled","Added membership card to Apple Wallet","Login","Connected to wifi","Contact merged in","Referral invite created","Referral invite completed"]},"source":{"type":"string"},"booking":{"anyOf":[{"$ref":"#/components/schemas/Booking-activity.read"},{"type":"null"}]},"externalReference":{"type":["string","null"]},"purchase":{"type":["string","null"],"format":"iri-reference"},"spend":{"description":"The amount of money spent, in the smallest currency unit. For example 100 would be equal to £1.00.","default":0,"type":"integer"},"giftCard":{"type":["string","null"],"format":"iri-reference"},"currencyCode":{"type":["string","null"]},"referralInvite":{"type":["string","null"],"format":"iri-reference"},"golfReservation":{"anyOf":[{"$ref":"#/components/schemas/Golf.reservation-activity.read"},{"type":"null"}]},"tableReservation":{"anyOf":[{"$ref":"#/components/schemas/Table.reservation-activity.read"},{"type":"null"}]}}},"Booking-activity.read":{"type":"object","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"numberOfGuests":{"type":"integer"},"roomType":{"type":["string","null"]},"roomName":{"type":["string","null"]},"externalReference":{"type":["string","null"]},"total":{"type":"integer"},"currencyCode":{"type":"string"},"customerReference":{"type":"string"},"purpose":{"type":"string"},"channelNumber":{"type":["string","null"]},"origin":{"type":"string"},"direct":{"default":false,"type":"boolean"},"status":{"type":"string","enum":["Inquired","Confirmed","Started","Processed","Canceled","Optional","Requested"]}}},"Golf.reservation-activity.read":{"type":"object","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"holes":{"type":"integer"},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"origin":{"description":"The source of the golf reservation, e.g. the booking system or channel through which it was made.","type":"string"},"originReference":{"description":"The ID or reference in the origin platform of the golf reservation, e.g. the booking system or channel reference.","default":"","type":"string"},"customerBookingReference":{"description":"The reference given to the customer for the golf reservation.","default":"","type":"string"},"cancelledAt":{"type":["string","null"],"format":"date-time"},"courseId":{"default":"","type":"string"},"courseName":{"default":"","type":"string"}}},"Table.reservation-activity.read":{"type":"object","description":"Represents a dining reservation made by a contact with details about the reservation, such as the party size, status, and any notes.","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"notes":{"type":"string"},"partySize":{"type":"integer"},"status":{"type":"string"},"origin":{"type":"string"},"originReference":{"type":"string"},"customerBookingReference":{"type":"string"},"cancelledAt":{"type":["string","null"],"format":"date-time"}}},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}}}},"paths":{"/activities/{id}":{"get":{"operationId":"api_activities_id_get","tags":["Activity"],"responses":{"200":{"description":"Activity resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Activity-activity.read"}}}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"404":{"description":"Not found","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}}},"summary":"Retrieve an activity","description":"Retrieve an activity","parameters":[{"name":"id","in":"path","description":"Activity identifier","required":true,"deprecated":false,"schema":{"type":"string"},"style":"simple","explode":false}]}}}}
```

## Delete an activity

> Deletes an activity. Only activities that were created via the API can be deleted.

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Activity","description":"An activity is an event that has happened to a contact, such as a booking, purchase, or interaction. Activities track the history of a contact and can trigger automations or workflows. Each activity is associated with a contact and has a type, source, and date. Some activities may also have a booking, order, or gift card associated with them."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}}}},"paths":{"/activities/{id}":{"delete":{"operationId":"api_activities_id_delete","tags":["Activity"],"responses":{"204":{"description":"Activity resource deleted"},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"404":{"description":"Not found","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}}},"summary":"Delete an activity","description":"Deletes an activity. Only activities that were created via the API can be deleted.","parameters":[{"name":"id","in":"path","description":"Activity identifier","required":true,"deprecated":false,"schema":{"type":"string"},"style":"simple","explode":false}]}}}}
```

## Update an activity

> Updates an activity. Only activities that were created via the API can be updated.

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Activity","description":"An activity is an event that has happened to a contact, such as a booking, purchase, or interaction. Activities track the history of a contact and can trigger automations or workflows. Each activity is associated with a contact and has a type, source, and date. Some activities may also have a booking, order, or gift card associated with them."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Activity-activity.read":{"type":"object","description":"An activity is an event that has happened to a contact, such as a booking, purchase, or interaction. Activities track the history of a contact and can trigger automations or workflows. Each activity is associated with a contact and has a type, source, and date. Some activities may also have a booking, order, or gift card associated with them.","properties":{"id":{"readOnly":true,"type":"integer"},"contact":{"type":"integer"},"happenedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["Booking","Checked in","Checked out","Purchase","Shopify order","Golf reservation","Table reservation","Gift card registered","Added gift card to Apple Wallet","Viewed partner offer","Clicked partner offer link","Added partner offer to Apple wallet","Added partner offer to Google wallet","Membership started","Changed tier","Membership cancelled","Added membership card to Apple Wallet","Login","Connected to wifi","Contact merged in","Referral invite created","Referral invite completed"]},"source":{"type":"string"},"booking":{"anyOf":[{"$ref":"#/components/schemas/Booking-activity.read"},{"type":"null"}]},"externalReference":{"type":["string","null"]},"purchase":{"type":["string","null"],"format":"iri-reference"},"spend":{"description":"The amount of money spent, in the smallest currency unit. For example 100 would be equal to £1.00.","default":0,"type":"integer"},"giftCard":{"type":["string","null"],"format":"iri-reference"},"currencyCode":{"type":["string","null"]},"referralInvite":{"type":["string","null"],"format":"iri-reference"},"golfReservation":{"anyOf":[{"$ref":"#/components/schemas/Golf.reservation-activity.read"},{"type":"null"}]},"tableReservation":{"anyOf":[{"$ref":"#/components/schemas/Table.reservation-activity.read"},{"type":"null"}]}}},"Booking-activity.read":{"type":"object","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"numberOfGuests":{"type":"integer"},"roomType":{"type":["string","null"]},"roomName":{"type":["string","null"]},"externalReference":{"type":["string","null"]},"total":{"type":"integer"},"currencyCode":{"type":"string"},"customerReference":{"type":"string"},"purpose":{"type":"string"},"channelNumber":{"type":["string","null"]},"origin":{"type":"string"},"direct":{"default":false,"type":"boolean"},"status":{"type":"string","enum":["Inquired","Confirmed","Started","Processed","Canceled","Optional","Requested"]}}},"Golf.reservation-activity.read":{"type":"object","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"holes":{"type":"integer"},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"origin":{"description":"The source of the golf reservation, e.g. the booking system or channel through which it was made.","type":"string"},"originReference":{"description":"The ID or reference in the origin platform of the golf reservation, e.g. the booking system or channel reference.","default":"","type":"string"},"customerBookingReference":{"description":"The reference given to the customer for the golf reservation.","default":"","type":"string"},"cancelledAt":{"type":["string","null"],"format":"date-time"},"courseId":{"default":"","type":"string"},"courseName":{"default":"","type":"string"}}},"Table.reservation-activity.read":{"type":"object","description":"Represents a dining reservation made by a contact with details about the reservation, such as the party size, status, and any notes.","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"notes":{"type":"string"},"partySize":{"type":"integer"},"status":{"type":"string"},"origin":{"type":"string"},"originReference":{"type":"string"},"customerBookingReference":{"type":"string"},"cancelledAt":{"type":["string","null"],"format":"date-time"}}},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}},"ConstraintViolation.jsonld":{"type":"object","description":"Unprocessable entity","properties":{"status":{"default":422,"type":"integer"},"violations":{"type":"array","items":{"type":"object","properties":{"propertyPath":{"type":"string","description":"The property path of the violation"},"message":{"type":"string","description":"The message associated with the violation"},"code":{"type":"string","description":"The code of the violation"},"hint":{"type":"string","description":"An extra hint to understand the violation"},"payload":{"type":"object","additionalProperties":true,"description":"The serialized payload of the violation"}},"required":["propertyPath","message"]}},"detail":{"readOnly":true,"type":"string"},"description":{"readOnly":true,"type":"string"},"type":{"readOnly":true,"type":"string"},"title":{"readOnly":true,"type":["string","null"]},"instance":{"readOnly":true,"type":["string","null"]}}},"ConstraintViolation":{"type":"object","description":"Unprocessable entity","properties":{"status":{"default":422,"type":"integer"},"violations":{"type":"array","items":{"type":"object","properties":{"propertyPath":{"type":"string","description":"The property path of the violation"},"message":{"type":"string","description":"The message associated with the violation"},"code":{"type":"string","description":"The code of the violation"},"hint":{"type":"string","description":"An extra hint to understand the violation"},"payload":{"type":"object","additionalProperties":true,"description":"The serialized payload of the violation"}},"required":["propertyPath","message"]}},"detail":{"readOnly":true,"type":"string"},"type":{"readOnly":true,"type":"string"},"title":{"readOnly":true,"type":["string","null"]},"instance":{"readOnly":true,"type":["string","null"]}}},"Activity-activity.write.jsonMergePatch":{"type":"object","description":"An activity is an event that has happened to a contact, such as a booking, purchase, or interaction. Activities track the history of a contact and can trigger automations or workflows. Each activity is associated with a contact and has a type, source, and date. Some activities may also have a booking, order, or gift card associated with them.","properties":{"id":{"readOnly":true,"type":"integer"},"contact":{"type":"integer"},"happenedAt":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["Booking","Checked in","Checked out","Purchase","Shopify order","Golf reservation","Table reservation","Gift card registered","Added gift card to Apple Wallet","Viewed partner offer","Clicked partner offer link","Added partner offer to Apple wallet","Added partner offer to Google wallet","Membership started","Changed tier","Membership cancelled","Added membership card to Apple Wallet","Login","Connected to wifi","Contact merged in","Referral invite created","Referral invite completed"]},"source":{"type":"string"},"booking":{"anyOf":[{"$ref":"#/components/schemas/Booking-activity.write"},{"type":"null"}]},"externalReference":{"type":["string","null"]},"purchase":{"type":["string","null"],"format":"iri-reference"},"spend":{"description":"The amount of money spent, in the smallest currency unit. For example 100 would be equal to £1.00.","default":0,"type":"integer"},"giftCard":{"type":["string","null"],"format":"iri-reference"},"currencyCode":{"type":["string","null"]},"referralInvite":{"type":["string","null"],"format":"iri-reference"},"golfReservation":{"anyOf":[{"$ref":"#/components/schemas/Golf.reservation-activity.write"},{"type":"null"}]},"tableReservation":{"anyOf":[{"$ref":"#/components/schemas/Table.reservation-activity.write"},{"type":"null"}]}}},"Booking-activity.write":{"type":"object","description":"A booking, sometimes called a reservation, is a stay associated with a contact.","properties":{"checkIn":{"type":"string","format":"date-time"},"checkOut":{"type":"string","format":"date-time"},"numberOfGuests":{"type":"integer"},"roomType":{"type":["string","null"]},"roomName":{"type":["string","null"]},"externalReference":{"type":["string","null"]},"total":{"type":"integer"},"currencyCode":{"type":"string"},"customerReference":{"type":"string"},"purpose":{"type":"string"},"channelNumber":{"type":["string","null"]},"origin":{"type":"string"},"direct":{"default":false,"type":"boolean"},"status":{"type":"string","enum":["Inquired","Confirmed","Started","Processed","Canceled","Optional","Requested"]}}},"Golf.reservation-activity.write":{"type":"object","properties":{"holes":{"type":"integer"},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"origin":{"description":"The source of the golf reservation, e.g. the booking system or channel through which it was made.","type":"string"},"originReference":{"description":"The ID or reference in the origin platform of the golf reservation, e.g. the booking system or channel reference.","default":"","type":"string"},"customerBookingReference":{"description":"The reference given to the customer for the golf reservation.","default":"","type":"string"},"cancelledAt":{"type":["string","null"],"format":"date-time"},"courseId":{"default":"","type":"string"},"courseName":{"default":"","type":"string"}}},"Table.reservation-activity.write":{"type":"object","description":"Represents a dining reservation made by a contact with details about the reservation, such as the party size, status, and any notes.","properties":{"notes":{"type":"string"},"partySize":{"type":"integer"},"status":{"type":"string"},"origin":{"type":"string"},"originReference":{"type":"string"},"customerBookingReference":{"type":"string"},"cancelledAt":{"type":["string","null"],"format":"date-time"}}}}},"paths":{"/activities/{id}":{"patch":{"operationId":"api_activities_id_patch","tags":["Activity"],"responses":{"200":{"description":"Activity resource updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Activity-activity.read"}}},"links":{}},"400":{"description":"Invalid input","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"404":{"description":"Not found","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"422":{"description":"An error occurred","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/ConstraintViolation.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ConstraintViolation"}},"application/json":{"schema":{"$ref":"#/components/schemas/ConstraintViolation"}}},"links":{}}},"summary":"Update an activity","description":"Updates an activity. Only activities that were created via the API can be updated.","parameters":[{"name":"id","in":"path","description":"Activity identifier","required":true,"deprecated":false,"schema":{"type":"string"},"style":"simple","explode":false}],"requestBody":{"description":"The updated Activity resource","content":{"application/merge-patch+json":{"schema":{"$ref":"#/components/schemas/Activity-activity.write.jsonMergePatch"}}},"required":true}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://glu.gitbook.io/docs/api-reference/organisation-api/activity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
