Skip to main content

Get Pin Allocation Details

Retrieve the current details of a specific GreenPin allocation, including its virtual number, PIN, associated parties, status, and call count.

HTTP Request​

GET https://leadassist.exotel.in/v1/tenants/<tenant_id>/greenpin/<greenpin_id>

Headers​

HeaderValue
AuthorizationHTTP Basic Auth — Account SID as username, ExoBridge token as password

Path Parameters​

ParameterDescription
tenant_idYour tenant identifier
greenpin_idThe unique identifier of the GreenPin allocation to retrieve

Example Request​

curl -X GET \
'https://leadassist.exotel.in/v1/tenants/<tenant_id>/greenpin/gp_abc123xyz' \
-u '<account_sid>:<exobridge_token>'

Example Response​

{
"response": {
"greenpin_id": "gp_abc123xyz",
"virtual_number": "+914000XXXXXX",
"pin": "4821",
"from": ["+919900XXXXXX"],
"to": ["+918800XXXXXX"],
"status": "active",
"created_at": "2024-06-15T10:30:00+05:30",
"expires_at": "2024-06-15T11:30:00+05:30",
"call_count": 2,
"custom_field": "order_id=12345"
}
}

Response Fields​

FieldTypeDescription
greenpin_idStringUnique identifier for this allocation.
virtual_numberStringThe virtual number assigned to this allocation.
pinStringThe PIN the B-party enters after calling the virtual number.
fromArray of StringsA-party phone number(s).
toArray of StringsB-party phone number(s). Empty array if not yet assigned.
statusStringCurrent state: active, expired, or deleted.
created_atStringISO 8601 timestamp of allocation creation.
expires_atStringISO 8601 timestamp when the allocation expires.
call_countIntegerTotal number of calls connected through this allocation since creation.
custom_fieldStringCustom metadata string set at creation or last update, if any.

HTTP Status Codes​

Status CodeMeaning
200 OKRequest successful. Response body contains the allocation object.
401 UnauthorizedAuthentication failed. Verify your Account SID and ExoBridge token.
403 ForbiddenYou do not have permission to access this allocation.
404 Not FoundNo allocation exists for the given greenpin_id under this tenant.
500 Internal Server ErrorUnexpected server error. Retry with exponential backoff.

Getting Call Metadata​

You can retrieve metadata for calls that were connected through an allocation using two methods:

1. Events Callbacks (Push)​

Configure a webhook URL on your account to receive real-time call data as events are triggered. Events are sent as HTTP POST requests to your endpoint for call states such as initiated, ringing, answered, and completed.

2. GET Call API (Pull)​

Query individual call details using the CallSID returned in an event callback or an allocation's call log.

curl -X GET \
'https://api.exotel.com/v1/Accounts/<account_sid>/Calls/<call_sid>.json' \
-u '<account_sid>:<auth_token>'

Example response for a CallSID lookup:

{
"Call": {
"Sid": "b8f3c1d2e4a5",
"From": "+918800XXXXXX",
"To": "+914000XXXXXX",
"Status": "completed",
"StartTime": "2024-06-15T10:45:00+05:30",
"EndTime": "2024-06-15T10:48:32+05:30",
"Duration": "212",
"RecordingUrl": "https://s3.ap-south-1.amazonaws.com/exorecordings/...",
"CustomField": "order_id=12345"
}
}

The CustomField in the call record reflects the custom_field value from the GreenPin allocation that was active at the time of the call.