Skip to content

POST registries/legal_entities/search

Search the Próspera legal-entity registry by name or by the entity's own resident permit number.

Endpoint

text
POST /api/v1/registries/legal_entities/search

Authentication

This endpoint accepts:

  • a standard API key (sk-)
  • an Agent Key (ak-) with the agent:registry.search scope

Send the key in the Authorization header:

text
Authorization: Bearer <your-api-key-or-agent-key>

Request Body

FieldTypeRequiredDescription
querystringYesFree-text search input. The handler splits name searches on spaces and also checks the entity's own resident permit number for partial matches.

Example Request

bash
curl -X POST https://portal.eprospera.com/api/v1/registries/legal_entities/search \
  -H "Authorization: Bearer <your-api-key-or-agent-key>" \
  -H "Content-Type: application/json" \
  -d '{"query": "Acme Holdings"}'

Response

Success Response (200 OK)

FieldTypeDescription
resultsarrayMatching legal entities.

Result Object

FieldTypeDescription
idstringLegal-entity ID.
namestringLegal name.
extensionstringName extension such as LLC.
residentPermitNumberstring | nullThe entity's own resident permit number.

Example Response

json
{
  "results": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "Acme Holdings",
      "extension": "LLC",
      "residentPermitNumber": "80000000000123"
    }
  ]
}

Search Behavior

  • Name search is case-insensitive.
  • Multi-word queries are split on spaces; each word is matched independently against entity names.
  • RPN search is a partial contains match on the entity's own resident permit number.
  • The current implementation does not filter results down to active entities only.

Error Responses

400 Bad Request

json
{
  "error": "Missing `query` parameter"
}

401 Unauthorized

json
{
  "error": "Missing API key"
}

or:

json
{
  "error": "Invalid API key"
}

403 Forbidden

Agent Key missing the required agent:registry.search scope:

json
{
  "error": "Insufficient permissions"
}

429 Too Many Requests

Rate limit exceeded:

json
{
  "error": "Rate limit exceeded. Maximum 5000 calls per day, 50 calls per minute."
}

500 Internal Server Error

json
{
  "error": "Internal server error"
}