> For the complete documentation index, see [llms.txt](https://flapjax.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flapjax.gitbook.io/docs/rest-api/reference/record-events/get-record-by-record-id.md).

# Get Record by Record ID

## Get record by record ID

> Retrieves a single record by its internal record ID (MongoDB ObjectID) within the specified stack. The \`record\_id\` must be a valid 24-character hex string.\
> \
> Returns a 400 error with \`InvalidParameter\` status if the record ID is not a valid ObjectID format, and a 500 error if the record is not found.<br>

```json
{"openapi":"3.0.3","info":{"title":"Listener API","version":"1.0.0"},"tags":[{"name":"get-record-by-record-id"}],"servers":[{"url":"https://{domain}/v1","variables":{"domain":{"default":"your-domain","description":"Your deployment domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token with the required scope for the endpoint. Pass via the `Authorization: Bearer <token>` header.\n"}},"parameters":{"StackKey":{"name":"stack_key","in":"path","required":true,"description":"The unique key identifying the stack.","schema":{"type":"string"}},"RecordId":{"name":"record_id","in":"path","required":true,"description":"The internal record ID. Must be a valid MongoDB ObjectID hex string (24 characters).\n","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}}},"schemas":{"RecordResponse":{"type":"object","description":"Response envelope containing a record object.","properties":{"status":{"type":"string","enum":["Success"]},"data":{"$ref":"#/components/schemas/Record"}}},"Record":{"type":"object","description":"A record object within a stack.","properties":{"record_id":{"type":"string","description":"Internal MongoDB ObjectID."},"external_id":{"type":"string","description":"External identifier."}},"additionalProperties":{"description":"Attribute values as defined by the stack's schema."}},"ErrorResponse":{"type":"object","description":"Standard error response envelope.","properties":{"error":{"type":"string","description":"Machine-readable error type. Use this for programmatic error handling.\n","enum":["operation_failed","failed_binding_json","invalid_json","invalid_parameter","not_found","duplicate_entry","rate_limit_exceeded"]},"errorstack":{"type":"object","nullable":true,"description":"Detailed error stack (only present for server errors)."}}}}},"paths":{"/stacks/{stack_key}/internal/{record_id}":{"get":{"summary":"Get record by record ID","operationId":"getRecordByRecordId","tags":["get-record-by-record-id"],"description":"Retrieves a single record by its internal record ID (MongoDB ObjectID) within the specified stack. The `record_id` must be a valid 24-character hex string.\n\nReturns a 400 error with `InvalidParameter` status if the record ID is not a valid ObjectID format, and a 500 error if the record is not found.\n","parameters":[{"$ref":"#/components/parameters/StackKey"},{"$ref":"#/components/parameters/RecordId"}],"responses":{"200":{"description":"Record found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordResponse"}}}},"400":{"description":"Invalid record ID format.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Record or stack not found, or internal error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```
