Me API
Me endpoints exposed by the Devotel CPaaS API Base path:/api/v1/me
Endpoint count: 14
Working with this group
Every operation under/me reads or writes only the authenticated caller’s own resources: profile preferences, speed-dial favorites, saved campaign drafts, report history, recommendation drafts, and ring rules. The credential on the request determines the tenant: an API key (dv_live_sk_* or dv_test_sk_*) resolves to the organization that owns the key, while a dashboard session resolves to the organization the signed-in user is currently working in.
First call: the identity probe
GET /api/v1/me is the first call every SDK quick start makes: it proves the credential works and returns the identity, organization id, and plan that every later request acts under. Authorization is role-based, so the response carries the caller’s role on the user object and per organization; there is no per-call scope list to request.
cURL
200
List saved campaign drafts from any SDK
GET /api/v1/me/campaign-drafts returns the caller’s saved AI campaign drafts in data.drafts. The history is capped at 50 drafts, so the full list arrives in one response and there is no cursor to follow; meta carries the correlation fields only. The same call in four styles:
200
Correlating a request
Every response on this page repeatsmeta.request_id, a server-generated id for exactly one request. Quote it when reporting a failed call or reading your request logs: support and diagnostics resolve it to the same request across services. meta.timestamp is the server time the response was produced.
title: “Worked identity and org-context samples” description: “The startup introspection chain — call GET /me, read identity + tenant + memberships, decide on the caller’s role — plus a worked sweep of the per-user me/* resources (ring rules, favorites, campaign drafts, generated reports) and the authentication failures this probe surfaces first.”
Worked identity and org-context samples
Bootstrap the session, then decide: callGET /api/v1/me at startup before touching any resource operation, read data.user, data.tenant, and data.organizations out of the same envelope, and branch on the caller’s role before you call a write path.
Every signed-in client resolves identity through this probe — the dashboard’s org picker and the mobile client both bootstrap from it. Cache the response per session, keep meta.request_id for support correlation, and re-fetch only on org switch or role change.
Worked sequence: dashboard-adjacent operator reads
Theme/* GETs below are the per-user state the dashboard piles onto the post-login bootstrap: distinctive-ring rules, speed-dial favorites, saved AI campaign drafts, and generated-report history. Chain them in this order so a mobile or API client can render the operator’s own resources in one sweep; a drafted campaign row travels as one entry of data.drafts[] with the brief, the generated copy, and the target channels.
data.drafts[] from the third call above (the generated blueprint is null when the row was saved brief-only):
data.draft: null on the Recommendations tester), so render your empty-view CTA rather than a table skeleton.
Worked reads — ring rules and favorites
Each per-user read below is the second leg of the worked sequence: theGET the bootstrap chain fires, paired with the envelope it answers. Chain them after GET /me resolves the caller.
Ring rules — the caller’s distinctive-ring rules
GET /api/v1/me/ring-rulesdata.patterns is the picker catalog the dashboard renders for the rule editor.
Request
Favorites — one-tap dial targets
GET /api/v1/me/favoritessort_order then creation time — the dialpad’s one-tap call surface. label is null when the caller never named the target.
Request
Campaign drafts — the AI Studio draft history
GET /api/v1/me/campaign-draftsdraft is null when the row was saved brief-only, so gate the preview panel on its presence.
Request
Read the authenticated caller
GET /api/v1/medata keys always arrive together: user carries the identity fields above plus the caller’s per-user preferences (softphone layout, voicemail-to-email opt-in, inbox signature), tenant is the organization context every subsequent request runs in, and organizations lists every membership with the caller’s role in each.
Preflight: decide on the caller’s role
Branch on
data.user.role / membership role before calling a write pathdata.user), which organization the key is bound to (data.tenant.slug), and whether the caller’s role in that org justifies the call you are about to make (data.organizations[].role). A workspace-scoped key resolves to exactly one tenant; multi-org dashboard (Clerk-session) callers receive every membership in data.organizations. An admin-of-one-org membership appears alongside the rest — treat the per-org role as the decision input and the org-scoped endpoint’s own verdict as authoritative.
A
200 on /me tells you the credential is good — it never tells you a write will succeed. Read the role, decide, and treat the operation’s own 403 as the authoritative verdict when the table disagrees with your role map.
Org-context and capability probes in the me surface
The me surface resolves the caller’s active organization context and capability footprint. Use these probes to hide unsupported actions, decide whether an organization area should surface in the dashboard, and map each caller to the operations they can drive. TheGET /me envelope is the org-context probe: it resolves the active tenant and memberships in one round trip.
Request
data.tenant block carries the active organization footprint (id, name, slug, plan) every subsequent request runs against; data.organizations lists every membership with the caller’s role. Prefer this single envelope over a second call — there is no separate GET /me/org or GET /me/memberships path; the memberships guard lives on this envelope.
Membership / role guard
Resolve the caller’s membership in the active organization before any write path and gate on itsrole — the same guard the dashboard applies when opening an organization area.
role is the only role input the me surface honors — org-scoped endpoints refuse operations the role does not carry.
Feature-gate probe — predictive activation schedule
GET /api/v1/me/predictive-activation-scheduleGET /api/v1/me/predictive-activation-schedule is the capability probe for the predictive-models panel: it returns the caller’s per-model auto-activation schedule intent, or data.schedule: null when no schedule is saved. SDK helpers use null to hide the panel and non-null to render it, so the probe doubles as the feature gate.
Request
featuresEnabled.predictiveSchedule = data.schedule !== null, and each model key that survives the server registry (churn_propensity, conversion_intent, lifetime_value, engagement_fatigue) marks its panel as enabled. A PUT on the same path toggles the intent — treat the read as the probe and the write as the setter, never cache the write’s response as the gate.
Chain — authenticated caller → memberships → capabilities
The standard bootstrap chain the me surface supports: (1) callGET /me to resolve identity, (2) guard on data.organizations membership for the active organization, and (3) probe GET /me/predictive-activation-schedule so unsupported actions stay hidden.
Errors worth branching on
This probe is where an invalid credential surfaces first — an integration that skips the bootstrap re-discovers the same401 on every later call. The mechanics of the envelope (error.code / message / status / details, the meta.docs_url trail) are owned by the error handling guide; only the /me-specific branch is hers.
401 — the credential itself fails
401 on this probe means the X-API-Key header value itself fails — it never means the identity payload moved. The failure precedes tenant resolution, so there is no data envelope to fall back to. Read meta.docs_url for the code’s remedy anchor; rotate the key or mint a new one, because retrying the same header re-fails identically.
Retry matrix
The platform-wide retry-vs-terminal decision table lives in the error handling guide.
List campaign-drafts
GET /api/v1/me/campaign-draftsstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.List favorites
GET /api/v1/me/favoritessort_order then creation time — the dialpad’s one-tap call surface. Use it to populate the Favorites tab on a softphone or mobile dialer. Scoped strictly to the signed-in user; a row id leaked from another user never resolves here.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.List generated-reports
GET /api/v1/me/generated-reportsstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Get predictive-activation schedule
GET /api/v1/me/predictive-activation-scheduledata.schedule is null when no schedule has been saved).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.List recommendations-draft
GET /api/v1/me/recommendations-draftstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.List ring-rules
GET /api/v1/me/ring-rulesstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Create a favorite
POST /api/v1/me/favoritesFAVORITE_LIMIT_REACHED when full) and rejects a duplicate target (409 FAVORITE_ALREADY_EXISTS). The target format is checked against target_kind: pstn values must be E.164 and sip values must start with sip: (422 otherwise). Favorites store dial INTENT only — placing a call to a pinned target routes through the normal outbound calling surface.
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.string (enum: pstn|extension|contact_id|sip)
required
What the pinned dial target is:
pstn (a public E.164 phone number, e.g. +442071234567), extension (a short internal extension), contact_id (a CRM/directory reference), or sip (a SIP URI beginning sip:). Drives validation of target_value.string
required
The dial target itself. Format must match
target_kind: E.164 for pstn (422 otherwise), a sip:-prefixed URI for sip, free-form for extension and contact_id.string | null
Display label the dialpad shows for this pin (≤ 64 chars). Omit or pass null to render the target itself.
integer
Position in the favorites list — lower sorts first. Defaults to 0 (top).
Update campaign-drafts
PUT /api/v1/me/campaign-draftsstring
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Update generated-reports
PUT /api/v1/me/generated-reportsstring
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Replace predictive-activation schedule
PUT /api/v1/me/predictive-activation-scheduleenabled (an explicit OFF survives), the cadence, the per-run topN (1–500), and a human-readable nameTemplate rendered into the new segment’s name. Accepted model keys mirror the server-owned registry (churn_propensity, conversion_intent, lifetime_value, engagement_fatigue); any other key is a 400. Merged into the caller’s preferences without clobbering siblings.
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.object
required
Per-model schedule intent map (partial record — only toggled models).
Update recommendations-draft
PUT /api/v1/me/recommendations-draftstring
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Update ring-rules
PUT /api/v1/me/ring-rulesstring
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Update a favorite
PATCH /api/v1/me/favorites/{id}label and sort_order are mutable — the dial target itself is fixed at creation; delete and re-pin to change it. Fields omitted from the body are left untouched, and a body with no recognised field returns 200 with data.updated: false. Returns 404 when the id does not belong to the caller (cross-user ids resolve to not-found, never another user’s row).
string
required
Favorite id (
favorite_ + suffix), as returned by create or list.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.string | null
Replacement display label (≤ 64 chars), or null to clear the label.
integer
New position in the favorites list — lower sorts first.
Delete a favorite
DELETE /api/v1/me/favorites/{id}string
required
Favorite id (
favorite_ + suffix), as returned by create or list.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.