{"openapi":"3.0.3","info":{"title":"PYLO public API","version":"1","description":"Read-only access to one PYLO workspace's sales figures, for dashboards and tools that read PYLO live. Create a token in PYLO under Settings, API tokens, and send it as `Authorization: Bearer <token>`. A token reads exactly one workspace, the one it was created in, and can never write: PYLO stays the system of record."},"servers":[{"url":"https://api.pylosystem.com"}],"components":{"securitySchemes":{"bearerToken":{"type":"http","scheme":"bearer","description":"A PYLO API token, pylo_ followed by 64 hex characters."}},"schemas":{"Envelope":{"type":"object","description":"Every answer. `notes` names anything PYLO could not answer, so a short list and a broken one never look the same.","properties":{"workspace":{"type":"object","properties":{"id":{"type":"string"},"currency":{"type":"string"}},"required":["id","currency"]},"period":{"type":"object","nullable":true,"properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"}}},"data":{"type":"object","additionalProperties":true,"description":"The answer. Figures inside it have the Field shape."},"notes":{"type":"array","items":{"type":"object","properties":{"subject":{"type":"string"},"code":{"type":"string"},"reason":{"type":"string"}}}}},"required":["workspace","data","notes"]},"Field":{"type":"object","description":"One figure. `value` is null whenever PYLO could not honestly draw it, and `unavailable` then says why. A rate is a fraction, never a percentage, and carries both of its sides.","properties":{"metric":{"type":"string","description":"The metric registry id."},"label":{"type":"string"},"unit":{"type":"string","enum":["count","money","rate"]},"value":{"type":"number","nullable":true},"currency":{"type":"string","description":"Money only. ISO 4217."},"numerator":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"number","nullable":true}}},"denominator":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"number","nullable":true}}},"unavailable":{"type":"object","nullable":true,"properties":{"code":{"type":"string","enum":["no-numerator","no-denominator","empty-denominator","does-not-nest","not-computed"]},"reason":{"type":"string"}}}},"required":["metric","label","unit","value"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"reason":{"type":"string"},"message":{"type":"string"}}}}}}},"security":[{"bearerToken":[]}],"paths":{"/api/v1/whoami":{"get":{"operationId":"whoami","summary":"Check a token","description":"The workspace and token this request is authenticated as. The first call any integration should make. Read only.","parameters":[],"security":[{"bearerToken":[]}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"object","properties":{"id":{"type":"string"}}},"token":{"type":"object","properties":{"name":{"type":"string"}}},"access":{"type":"string","enum":["read-only"]}}}}}},"400":{"description":"A parameter PYLO cannot use, named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or one PYLO does not accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/calls":{"get":{"operationId":"listCallFigures","summary":"Call figures","description":"Calls booked, taken, closed and the rates between them, for the period, each with both sides of every rate. Read only.","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"First day, YYYY-MM-DD. Defaults to 29 days before `to`."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Last day, YYYY-MM-DD. Defaults to today."}],"security":[{"bearerToken":[]}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"A parameter PYLO cannot use, named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or one PYLO does not accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/outcomes":{"get":{"operationId":"listOutcomes","summary":"Call outcomes","description":"Every call outcome in the period, counted. Read only.","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"First day, YYYY-MM-DD. Defaults to 29 days before `to`."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Last day, YYYY-MM-DD. Defaults to today."}],"security":[{"bearerToken":[]}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"A parameter PYLO cannot use, named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or one PYLO does not accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/payments":{"get":{"operationId":"listPaymentFigures","summary":"Cash and revenue","description":"Cash collected and revenue booked in the period, on the workspace's currency. Read only.","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"First day, YYYY-MM-DD. Defaults to 29 days before `to`."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Last day, YYYY-MM-DD. Defaults to today."}],"security":[{"bearerToken":[]}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"A parameter PYLO cannot use, named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or one PYLO does not accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/leads":{"get":{"operationId":"listLeads","summary":"Leads","description":"Leads created in the period, newest first, at most 500. Read only.","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"First day, YYYY-MM-DD. Defaults to 29 days before `to`."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Last day, YYYY-MM-DD. Defaults to today."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"description":"At most 500; a larger number is capped, not refused."}],"security":[{"bearerToken":[]}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"A parameter PYLO cannot use, named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or one PYLO does not accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/leads/{id}/journey":{"get":{"operationId":"getLeadJourney","summary":"One lead's journey","description":"Everything PYLO holds about one lead, in order: how they arrived, their calls, outcomes and payments. Read only.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"bearerToken":[]}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"A parameter PYLO cannot use, named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or one PYLO does not accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/speed-to-lead":{"get":{"operationId":"listSpeedToLead","summary":"Waiting leads","description":"Leads still waiting for a first contact, how long each has waited, and where to open them. Read only.","parameters":[{"name":"withinMinutes","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10080,"default":120}}],"security":[{"bearerToken":[]}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"A parameter PYLO cannot use, named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or one PYLO does not accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/eod":{"get":{"operationId":"listEodFigures","summary":"End of day reports","description":"EOD submissions and compliance for the period. Read only.","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"First day, YYYY-MM-DD. Defaults to 29 days before `to`."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Last day, YYYY-MM-DD. Defaults to today."}],"security":[{"bearerToken":[]}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"A parameter PYLO cannot use, named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or one PYLO does not accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attribution":{"get":{"operationId":"listAttribution","summary":"Attribution","description":"Leads, closes and cash by UTM source, medium, campaign and content. Read only.","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"First day, YYYY-MM-DD. Defaults to 29 days before `to`."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Last day, YYYY-MM-DD. Defaults to today."}],"security":[{"bearerToken":[]}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"A parameter PYLO cannot use, named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or one PYLO does not accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/commission":{"get":{"operationId":"listCommission","summary":"Commission","description":"Commission owed per member for the period. Read only.","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"First day, YYYY-MM-DD. Defaults to 29 days before `to`."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Last day, YYYY-MM-DD. Defaults to today."}],"security":[{"bearerToken":[]}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"A parameter PYLO cannot use, named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or one PYLO does not accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/funnel":{"get":{"operationId":"getFunnel","summary":"Funnel","description":"One funnel's stages for the period, each with its count and the rate from the stage before. Read only.","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"First day, YYYY-MM-DD. Defaults to 29 days before `to`."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Last day, YYYY-MM-DD. Defaults to today."},{"name":"funnel","in":"query","required":false,"schema":{"type":"string","default":"vsl"},"description":"Which funnel. An unknown name answers 400 naming the ones that exist."}],"security":[{"bearerToken":[]}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"A parameter PYLO cannot use, named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or one PYLO does not accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webinar":{"get":{"operationId":"getWebinar","summary":"Webinar","description":"Registrations, attendance, stay to pitch and bookings, for one webinar event or all of them. Read only.","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"First day, YYYY-MM-DD. Defaults to 29 days before `to`."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Last day, YYYY-MM-DD. Defaults to today."},{"name":"eventId","in":"query","required":false,"schema":{"type":"string"},"description":"One webinar event. Omit for all of them."}],"security":[{"bearerToken":[]}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"A parameter PYLO cannot use, named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or one PYLO does not accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/audit-events":{"get":{"operationId":"listAuditEvents","summary":"Audit log","description":"Every write recorded for this workspace in the period, with the actor, the target and the reason. Read only.","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"First day, YYYY-MM-DD. Defaults to 29 days before `to`."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Last day, YYYY-MM-DD. Defaults to today."}],"security":[{"bearerToken":[]}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"A parameter PYLO cannot use, named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or one PYLO does not accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}