# Activities

## Create a new activity for an account

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

```json
{"openapi":"3.0.1","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"url":"https://api.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.","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"}},"type":"object"},"CreateActivityResponseData":{"properties":{"success":{"type":"boolean"}},"type":"object"},"ErrorApiResponseBody":{"properties":{"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"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"}}},"paths":{"/accounts/{id}/activities":{"post":{"description":"The {id} parameter accepts either:\n\nInternal account ID (UUID format)\n\nExternal ID (any string format)\n\n**Rate limit:** 20 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"}}},"required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateActivityResponseBody"}}},"description":""},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""}},"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:\*\* 10 requests per minute

```json
{"openapi":"3.0.1","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"url":"https://api.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"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"}},"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"}},"type":"object"},"Pagination":{"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"],"type":"object"},"ErrorApiResponseBody":{"properties":{"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"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"}}},"paths":{"/activity-types":{"get":{"description":"Returns all custom activity type definitions for the organization.\n\n**Rate limit:** 10 requests per minute","operationId":"GetActivityTypes","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetActivityTypesResponseBody"}}},"description":""},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""}},"summary":"Get custom activity types","tags":["activity-types"]}}}}
```


---

# 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://docs.usepylon.com/pylon-docs/developer/api/api-reference/accounts/activities.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.
