> For the complete documentation index, see [llms.txt](https://docs.usepylon.com/pylon-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.usepylon.com/pylon-docs/developer/api/api-reference/accounts/activities.md).

# Activities

Create custom activity types and write new activity onto accounts.

## Create a new activity for an account

> The {id} parameter accepts either:\
> Internal account ID (UUID format)\
> External ID (any string format)\
> \
> \*\*Rate limit:\*\* 120 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"schemas":{"CreateActivityRequest":{"properties":{"body_html":{"description":"Optional HTML content to display in the activity.","type":"string"},"contact_id":{"description":"Optional contact ID of the actor of the activity.","type":"string"},"happened_at":{"description":"Timestamp (RFC3339) of when the activity happened. Defaults to the current time if empty.","format":"date-time","type":"string"},"link":{"description":"Optional link to add to the activity.","type":"string"},"link_text":{"description":"Optional link text to display on the activity. Defaults to \"Open link\" if not provided. Applies only if a link is provided.","type":"string"},"slug":{"description":"The slug of the activity to create.","type":"string"},"user_id":{"description":"Optional user ID of the actor of the activity.","type":"string"}},"required":["slug"],"type":"object"},"CreateActivityResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/CreateActivityResponseData"},"request_id":{"type":"string"}},"required":["data","request_id"],"type":"object"},"CreateActivityResponseData":{"properties":{"success":{"type":"boolean"}},"required":["success"],"type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`. This list is not exhaustive.","type":"string"},"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}},"responses":{"CreateActivityResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateActivityResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}}},"paths":{"/accounts/{id}/activities":{"post":{"description":"The {id} parameter accepts either:\nInternal account ID (UUID format)\nExternal ID (any string format)\n\n**Rate limit:** 120 requests per minute","operationId":"CreateActivity","parameters":[{"description":"The ID or external ID of the account to create the activity for.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateActivityRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/CreateActivityResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Create a new activity for an account","tags":["accounts"]}}}}
```

## Get custom activity types

> Returns all custom activity type definitions for the organization.\
> \
> \*\*Rate limit:\*\* 30 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetActivityTypesResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetActivityTypesResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetActivityTypesResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/ActivityType"},"type":"array"},"pagination":{"$ref":"#/components/schemas/Pagination"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"ActivityType":{"properties":{"icon_url":{"description":"The icon url of the activity type.","type":"string"},"id":{"description":"The ID of the activity type.","type":"string"},"label":{"description":"The label of the activity type.","type":"string"},"slug":{"description":"The slug of the activity type.","type":"string"}},"required":["icon_url","id","label","slug"],"type":"object"},"Pagination":{"description":"Pagination information for list responses. Absent when there are no more results.","properties":{"cursor":{"description":"The cursor for the next page of results.","type":"string"},"has_next_page":{"description":"Indicates if there is a next page of results.","type":"boolean"}},"required":["cursor","has_next_page"],"title":"Pagination","type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`. This list is not exhaustive.","type":"string"},"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}}},"paths":{"/activity-types":{"get":{"description":"Returns all custom activity type definitions for the organization.\n\n**Rate limit:** 30 requests per minute","operationId":"GetActivityTypes","responses":{"200":{"$ref":"#/components/responses/GetActivityTypesResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get custom activity types","tags":["activity-types"]}}}}
```

## Get custom activities for an account

> Returns custom activities for the specified account, ordered from newest to oldest.\
> The {id} parameter accepts either:\
> Internal account ID (UUID format)\
> External ID (any string format)\
> \
> \*\*Rate limit:\*\* 300 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetActivitiesResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetActivitiesResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetActivitiesResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/CustomActivity"},"type":"array"},"pagination":{"$ref":"#/components/schemas/Pagination"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"CustomActivity":{"properties":{"account_id":{"description":"The ID of the account that the activity belongs to.","type":"string"},"activity_type":{"allOf":[{"$ref":"#/components/schemas/ActivityType"}],"nullable":true},"body_html":{"description":"The HTML content displayed in the activity.","type":"string"},"contact_id":{"description":"The ID of the contact who performed the activity, if applicable.","type":"string"},"created_at":{"description":"The creation time of the activity in RFC3339 format.","format":"date-time","type":"string"},"happened_at":{"description":"The timestamp (RFC3339) when the activity happened.","format":"date-time","type":"string"},"id":{"description":"The ID of the activity.","type":"string"},"link":{"description":"The link associated with the activity.","type":"string"},"link_text":{"description":"The text displayed for the activity link.","type":"string"},"updated_at":{"description":"The last update time of the activity in RFC3339 format.","format":"date-time","type":"string"},"user_id":{"description":"The ID of the user who performed the activity, if applicable.","type":"string"}},"required":["account_id","created_at","happened_at","id","updated_at"],"type":"object"},"ActivityType":{"properties":{"icon_url":{"description":"The icon url of the activity type.","type":"string"},"id":{"description":"The ID of the activity type.","type":"string"},"label":{"description":"The label of the activity type.","type":"string"},"slug":{"description":"The slug of the activity type.","type":"string"}},"required":["icon_url","id","label","slug"],"type":"object"},"Pagination":{"description":"Pagination information for list responses. Absent when there are no more results.","properties":{"cursor":{"description":"The cursor for the next page of results.","type":"string"},"has_next_page":{"description":"Indicates if there is a next page of results.","type":"boolean"}},"required":["cursor","has_next_page"],"title":"Pagination","type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`. This list is not exhaustive.","type":"string"},"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}}},"paths":{"/accounts/{id}/activities":{"get":{"description":"Returns custom activities for the specified account, ordered from newest to oldest.\nThe {id} parameter accepts either:\nInternal account ID (UUID format)\nExternal ID (any string format)\n\n**Rate limit:** 300 requests per minute","operationId":"GetActivities","parameters":[{"description":"The ID or external ID of the account to fetch activities for.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"The custom activity type slug to filter by.","in":"query","name":"activity_type","schema":{"type":"string"}},{"description":"The start time (RFC3339) of the activity time range.","in":"query","name":"start_time","schema":{"format":"date-time","type":"string"}},{"description":"The end time (RFC3339) of the activity time range.","in":"query","name":"end_time","schema":{"format":"date-time","type":"string"}},{"description":"The cursor to use for pagination.","in":"query","name":"cursor","schema":{"type":"string"}},{"description":"The number of activities to fetch. Defaults to 100. Must be greater than 0 and less than or equal to 1000.","in":"query","name":"limit","schema":{"format":"int64","type":"integer"}}],"responses":{"200":{"$ref":"#/components/responses/GetActivitiesResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get custom activities for an account","tags":["accounts"]}}}}
```

## Get email activities for an account

> Returns email threads synced to the specified account from connected Gmail and Outlook inboxes, ordered by their latest email from newest to oldest.\
> The {id} parameter accepts either:\
> Internal account ID (UUID format)\
> External ID (any string format)\
> \
> \*\*Rate limit:\*\* 120 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetEmailActivitiesResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetEmailActivitiesResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetEmailActivitiesResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/EmailActivity"},"type":"array"},"pagination":{"$ref":"#/components/schemas/Pagination"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"EmailActivity":{"properties":{"account_id":{"description":"The ID of the account that the activity belongs to.","type":"string"},"happened_at":{"description":"The timestamp (RFC3339) when the thread's latest email was sent. A thread moves forward as it gets replies.","format":"date-time","type":"string"},"id":{"description":"The ID of the activity.","type":"string"},"messages":{"description":"The thread's emails sent from or to an account you can read, oldest first. Emails only between teammates are omitted.","items":{"$ref":"#/components/schemas/EmailActivityMessage"},"type":"array"}},"required":["account_id","happened_at","id","messages"],"type":"object"},"EmailActivityMessage":{"properties":{"contact_id":{"description":"The ID of the contact who sent the email, if the sender is a contact.","type":"string"},"email_info":{"$ref":"#/components/schemas/EmailMessageInfo"},"id":{"description":"The ID of the email message.","type":"string"},"issue_id":{"description":"The ID of the issue this email is on, if any. The issue messages endpoint also returns issue emails; match them by email_info.message_id.","type":"string"},"message_html":{"description":"The HTML body of the email.","type":"string"},"subject":{"description":"The subject of the email.","type":"string"},"timestamp":{"description":"The time the email was sent.","format":"date-time","type":"string"},"user_id":{"description":"The ID of the user who sent the email, if the sender is a Pylon user.","type":"string"}},"required":["email_info","id","message_html","subject","timestamp"],"type":"object"},"EmailMessageInfo":{"properties":{"bcc_emails":{"description":"The email addresses of the BCC recipients of the message.","items":{"type":"string"},"nullable":true,"type":"array"},"cc_emails":{"description":"The email addresses of the CC recipients of the message.","items":{"type":"string"},"nullable":true,"type":"array"},"from_email":{"description":"The email address of the sender of the message.","type":"string"},"message_id":{"description":"The RFC 5322 Message-ID header value for this email. This is a provider-specific identifier, not the top-level Pylon message ID, and cannot be used as message_id when posting a reply or internal note.","type":"string"},"opens":{"description":"When each recipient first opened an email Pylon sent, at most one entry per recipient.\nAlways empty for inbound mail and for mail sent through a connected personal email account.\nOpen tracking is approximate: clients that prefetch images (such as Apple Mail Privacy Protection)\ncan report opens that never happened, and clients that block images report none.","items":{"$ref":"#/components/schemas/EmailEvent"},"nullable":true,"type":"array"},"sender_authentication_status":{"description":"The SPF/DKIM sender authentication result recorded by Pylon's inbound mail provider.\nOne of \"pass\", \"fail\", or \"unknown\".\n\"fail\" means SPF failed outright, or the message carried a DKIM signature that did not validate.\n\"pass\" means SPF passed, or a DKIM signature validated.\n\"unknown\" means nothing vouched for the sender and must not be read as a pass. It covers\nmail Pylon sent, mail synced from a personal email integration, submissions stored as email\nmessages, and senders whose domain published no SPF or DKIM records to check against.","type":"string"},"to_emails":{"description":"The email addresses of the recipients of the message.","items":{"type":"string"},"nullable":true,"type":"array"}},"required":["from_email","message_id","sender_authentication_status"],"type":"object"},"EmailEvent":{"properties":{"email":{"description":"The email address of the recipient the event applies to.","type":"string"},"time":{"description":"When the event happened, in RFC 3339 format.","type":"string"}},"required":["email","time"],"type":"object"},"Pagination":{"description":"Pagination information for list responses. Absent when there are no more results.","properties":{"cursor":{"description":"The cursor for the next page of results.","type":"string"},"has_next_page":{"description":"Indicates if there is a next page of results.","type":"boolean"}},"required":["cursor","has_next_page"],"title":"Pagination","type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`. This list is not exhaustive.","type":"string"},"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}}},"paths":{"/accounts/{id}/email-activities":{"get":{"description":"Returns email threads synced to the specified account from connected Gmail and Outlook inboxes, ordered by their latest email from newest to oldest.\nThe {id} parameter accepts either:\nInternal account ID (UUID format)\nExternal ID (any string format)\n\n**Rate limit:** 120 requests per minute","operationId":"GetEmailActivities","parameters":[{"description":"The ID or external ID of the account to fetch email activities for.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"The start time (RFC3339) of the activity time range, compared against each thread's latest email.","in":"query","name":"start_time","schema":{"format":"date-time","type":"string"}},{"description":"The end time (RFC3339) of the activity time range, compared against each thread's latest email.","in":"query","name":"end_time","schema":{"format":"date-time","type":"string"}},{"description":"The cursor to use for pagination.","in":"query","name":"cursor","schema":{"type":"string"}},{"description":"The number of email activities to fetch. Defaults to 20. Must be greater than 0 and less than or equal to 50.","in":"query","name":"limit","schema":{"format":"int64","type":"integer"}}],"responses":{"200":{"$ref":"#/components/responses/GetEmailActivitiesResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get email activities for an account","tags":["accounts"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.usepylon.com/pylon-docs/developer/api/api-reference/accounts/activities.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
