Logs-6
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
POST | |
GET | |
PATCH | |
DELETE | |
POST | |
POST | |
POST |
Retrieve logs has logs
Required API key scopes
logs:readExample request
GET /api /projects /:project_id /logs /has_logsExample response
Status 200
Create logs query
Required API key scopes
logs:readRequest parameters
- query
Response
Example request
POST /api /projects /:project_id /logs /queryExample response
Status 200
RESPONSE
Create logs query
Required API key scopes
logs:readRequest parameters
- query
Response
Example request
POST /api /projects /:project_id /logs /queryExample response
Status 200
RESPONSE
List all logs sampling rules
Required API key scopes
logs:readQuery parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /projects /:project_id /logs /sampling_rulesExample response
Status 200
RESPONSE
List all logs sampling rules
Required API key scopes
logs:readQuery parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /projects /:project_id /logs /sampling_rulesExample response
Status 200
RESPONSE
Create logs sampling rules
Required API key scopes
logs:writeRequest parameters
- namestring
- enabledbooleanDefault:
false - priorityintegernull
- rule_type
- scope_servicestringnull
- scope_path_patternstringnull
- scope_attribute_filtersarray
- config
Response
Example request
POST /api /projects /:project_id /logs /sampling_rulesExample response
Status 201
RESPONSE
Create logs sampling rules
Required API key scopes
logs:writeRequest parameters
- namestring
- enabledbooleanDefault:
false - priorityintegernull
- rule_type
- scope_servicestringnull
- scope_path_patternstringnull
- scope_attribute_filtersarray
- config
Response
Example request
POST /api /projects /:project_id /logs /sampling_rulesExample response
Status 201
RESPONSE
Retrieve logs sampling rules
Required API key scopes
logs:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /logs /sampling_rules /:idExample response
Status 200
RESPONSE
Retrieve logs sampling rules
Required API key scopes
logs:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /logs /sampling_rules /:idExample response
Status 200
RESPONSE
Update logs sampling rules
Required API key scopes
logs:writePath parameters
- idstring
Request parameters
- namestring
- enabledbooleanDefault:
false - priorityintegernull
- rule_type
- scope_servicestringnull
- scope_path_patternstringnull
- scope_attribute_filtersarray
- config
Response
Example request
PATCH /api /projects /:project_id /logs /sampling_rules /:idExample response
Status 200
RESPONSE
Update logs sampling rules
Required API key scopes
logs:writePath parameters
- idstring
Request parameters
- namestring
- enabledbooleanDefault:
false - priorityintegernull
- rule_type
- scope_servicestringnull
- scope_path_patternstringnull
- scope_attribute_filtersarray
- config
Response
Example request
PATCH /api /projects /:project_id /logs /sampling_rules /:idExample response
Status 200
RESPONSE
Delete logs sampling rules
Required API key scopes
logs:writePath parameters
- idstring
Example request
DELETE /api /projects /:project_id /logs /sampling_rules /:idExample response
Status 204 No response body
Delete logs sampling rules
Required API key scopes
logs:writePath parameters
- idstring
Example request
DELETE /api /projects /:project_id /logs /sampling_rules /:idExample response
Status 204 No response body
Create logs sampling rules simulate
Dry-run estimate for how much volume this rule would remove (placeholder response until CH-backed simulation is wired).
Path parameters
- idstring
Response
Example request
POST /api /projects /:project_id /logs /sampling_rules /:id /simulateExample response
Status 200
RESPONSE
Create logs sampling rules simulate
Dry-run estimate for how much volume this rule would remove (placeholder response until CH-backed simulation is wired).
Path parameters
- idstring
Response
Example request
POST /api /projects /:project_id /logs /sampling_rules /:id /simulateExample response
Status 200
RESPONSE
Create logs sampling rules reorder
Atomically reassign priorities so the given ID order maps to ascending priorities (0..n-1).
Query parameters
- limitinteger
- offsetinteger
Request parameters
- ordered_idsarray
Response
Example request
POST /api /projects /:project_id /logs /sampling_rules /reorderExample response
Status 200
RESPONSE
Create logs sampling rules reorder
Atomically reassign priorities so the given ID order maps to ascending priorities (0..n-1).
Query parameters
- limitinteger
- offsetinteger
Request parameters
- ordered_idsarray
Response
Example request
POST /api /projects /:project_id /logs /sampling_rules /reorderExample response
Status 200
RESPONSE
Create logs services
Also available via the PostHog MCP server:
logs-services-create— List services with stats
Required API key scopes
logs:readRequest parameters
- query
Response
Example request
POST /api /projects /:project_id /logs /servicesExample response
Status 200
RESPONSE