> For the complete documentation index, see [llms.txt](https://docs.bookline.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bookline.io/partner-api/softphone.md).

# Softphone

## Who is this phone number in the CRM

> Resolves a phone number to its CRM identity (contact/venue/account, effective account, do-not-contact flags). Runs while the phone is ringing: fast or failing, never slow.

```json
{"openapi":"3.1.0","info":{"title":"Bookline Partner API","version":"1.12.9"},"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"apikey"}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/softphone/caller":{"get":{"tags":["softphone"],"summary":"Who is this phone number in the CRM","description":"Resolves a phone number to its CRM identity (contact/venue/account, effective account, do-not-contact flags). Runs while the phone is ringing: fast or failing, never slow.","operationId":"lookup_caller_softphone_caller_get","parameters":[{"name":"phone","in":"query","required":true,"schema":{"type":"string","minLength":3,"description":"The caller's number, ideally E.164","title":"Phone"},"description":"The caller's number, ideally E.164"},{"name":"x-bl-identity","in":"header","required":true,"schema":{"type":"string","minLength":1,"description":"The salesperson bl_identity (RS256 JWT from hub.bookline.ai). papi verifies it against the hub JWKS and forwards it to New Data, which uses it as the actor.","title":"X-Bl-Identity"},"description":"The salesperson bl_identity (RS256 JWT from hub.bookline.ai). papi verifies it against the hub JWKS and forwards it to New Data, which uses it as the actor."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Lookup Caller Softphone Caller Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Register a finished call as a CRM activity

> Creates the activity in New Data attributed to the acting user (x-bl-identity). Idempotent by sip\_callid: a retry returns the same activity with HTTP 200 instead of duplicating.

```json
{"openapi":"3.1.0","info":{"title":"Bookline Partner API","version":"1.12.9"},"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"apikey"}},"schemas":{"CallActivityCreate":{"properties":{"number":{"type":"string","minLength":3,"title":"Number"},"direction":{"type":"string","enum":["inbound","outbound"],"title":"Direction"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"talked_seconds":{"type":"integer","minimum":0,"title":"Talked Seconds","description":"Seconds SPOKEN. A missed call lasts 0."},"sip_status":{"anyOf":[{"type":"integer","maximum":699,"minimum":100},{"type":"null"}],"title":"Sip Status"},"sip_callid":{"type":"string","minLength":1,"title":"Sip Callid","description":"The Call-ID from jambonz CDR. Also the idempotency key."},"call_outcome":{"type":"string","enum":["answered","unanswered"],"title":"Call Outcome"},"call_type":{"type":"string","enum":["cold","follow_up","other"],"title":"Call Type","default":"other"},"notes":{"type":"string","title":"Notes","default":""},"contact_point_id":{"type":"string","minLength":1,"title":"Contact Point Id"},"links":{"items":{"$ref":"#/components/schemas/CallActivityLink"},"type":"array","title":"Links","default":[]}},"type":"object","required":["number","direction","started_at","talked_seconds","sip_callid","call_outcome","contact_point_id"],"title":"CallActivityCreate","description":"A finished call, as the extension's engine reports it (`FinishedCall`)."},"CallActivityLink":{"properties":{"target_type":{"type":"string","enum":["account","venue","contact","contact_point","lead"],"title":"Target Type"},"target_id":{"type":"string","title":"Target Id"}},"type":"object","required":["target_type","target_id"],"title":"CallActivityLink"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/softphone/call-activities":{"post":{"tags":["softphone"],"summary":"Register a finished call as a CRM activity","description":"Creates the activity in New Data attributed to the acting user (x-bl-identity). Idempotent by sip_callid: a retry returns the same activity with HTTP 200 instead of duplicating.","operationId":"create_call_activity_softphone_call_activities_post","parameters":[{"name":"x-bl-identity","in":"header","required":true,"schema":{"type":"string","minLength":1,"description":"The salesperson bl_identity (RS256 JWT from hub.bookline.ai). papi verifies it against the hub JWKS and forwards it to New Data, which uses it as the actor.","title":"X-Bl-Identity"},"description":"The salesperson bl_identity (RS256 JWT from hub.bookline.ai). papi verifies it against the hub JWKS and forwards it to New Data, which uses it as the actor."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallActivityCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Reclassify a registered call

> Applies the salesperson's classification (call\_type, call\_outcome) and notes to an existing activity, as the acting user.

```json
{"openapi":"3.1.0","info":{"title":"Bookline Partner API","version":"1.12.9"},"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"apikey"}},"schemas":{"CallActivityUpdate":{"properties":{"call_type":{"anyOf":[{"type":"string","enum":["cold","follow_up","other"]},{"type":"null"}],"title":"Call Type"},"call_outcome":{"anyOf":[{"type":"string","enum":["answered","unanswered"]},{"type":"null"}],"title":"Call Outcome"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"CallActivityUpdate","description":"What the salesperson adjusts on save: the type, the outcome and the notes."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/softphone/call-activities/{activity_id}":{"patch":{"tags":["softphone"],"summary":"Reclassify a registered call","description":"Applies the salesperson's classification (call_type, call_outcome) and notes to an existing activity, as the acting user.","operationId":"update_call_activity_softphone_call_activities__activity_id__patch","parameters":[{"name":"activity_id","in":"path","required":true,"schema":{"type":"string","title":"Activity Id"}},{"name":"x-bl-identity","in":"header","required":true,"schema":{"type":"string","minLength":1,"description":"The salesperson bl_identity (RS256 JWT from hub.bookline.ai). papi verifies it against the hub JWKS and forwards it to New Data, which uses it as the actor.","title":"X-Bl-Identity"},"description":"The salesperson bl_identity (RS256 JWT from hub.bookline.ai). papi verifies it against the hub JWKS and forwards it to New Data, which uses it as the actor."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallActivityUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Call Activity Softphone Call Activities  Activity Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```
