{"openapi":"3.0.3","info":{"title":"Management Service API","description":"API for Evidence Studio","version":"0.0.1"},"components":{"securitySchemes":{"secretKey":{"type":"apiKey","name":"Authorization","in":"header","description":"API Key authentication using header: <code>Authorization: Key <REPLACE_BY_API_KEY> </code>"},"cookieAuth":{"type":"apiKey","name":"wos-session","in":"cookie","description":"Session cookie authentication via WorkOS"},"APTCookieAuth":{"type":"apiKey","name":"studio-apt","in":"cookie","description":"Auth Proxy Token authentication"},"APTKey":{"type":"apiKey","name":"Authorization","in":"header","description":"API Key authentication using header: <code>Authorization: APT <REPLACE_BY_API_KEY> </code>"}}},"paths":{"/health":{"get":{"summary":"Health","tags":["Service"],"description":"Get Service Health","security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","description":"status of service","example":"ok"},"instanceId":{"type":"string","description":"id of instance","example":"aaeeffdd"}},"required":["status","instanceId"]}}}}}}},"/ready":{"get":{"summary":"Ready","tags":["Service"],"description":"Get service readiness","security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","description":"status of service","example":"ok"},"instanceId":{"type":"string","description":"id of instance","example":"aaeeffdd"}},"required":["status","instanceId"]}}}}}}},"/v1/deploy/schema":{"put":{"summary":"Test Connection","tags":["Deploy"],"description":"Test connection by reading the schema from database","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"type of connection"},"value":{"type":"string","description":"secret value in base64"},"path":{"type":"string","description":"allow to filter files or folder for bucket or iceberg connector"}},"required":["type","value"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"tables":{"type":"array","items":{"type":"object","properties":{"schema":{"type":"string","description":"The SQL schema of the table","example":"public"},"table":{"type":"string","description":"The name of the table","example":"customers"}},"required":["schema","table"]}},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the column","example":"my_col"},"type":{"type":"string","description":"The type of the column in parquet","example":"int64"}},"required":["name","type"]}},"warning":{"type":"string","description":"Warning message, e.g. when results are truncated"}}},{"type":"object","properties":{"error":{"type":"string","description":"message of the response"}},"required":["error"]}]}}}},"401":{"description":"This feature isn't available with your current permissions, upgrade your role","content":{"application/json":{"schema":{}}}},"412":{"description":"failed to connect","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/deploy/connector":{"get":{"summary":"Get Connector Manifest","tags":["Deploy"],"description":"Returns the connection manifest & options for the connector type","parameters":[{"schema":{"type":"string"},"in":"query","name":"type","required":true,"description":"type of connection"}],"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{},{"type":"object","properties":{"error":{"type":"string","description":"message of the response"}},"required":["error"]}]}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/deploy/source":{"post":{"summary":"Deploy Source Table","tags":["Deploy"],"description":"Deploy a source table to Evidence's managed data warehouse","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"unique job identifier for the deploy, use any string"},"source":{"type":"string","description":"name of the table to deploy from the source system; for remote file sources (BUCKET, DELTALAKE_S3, ICEBERG) this is a bucket-relative path to the file or table, slashes allowed"},"type":{"type":"string","description":"type of connection: BUCKET | REDSHIFT | SNOWFLAKE | BIGQUERY | MOTHERDUCK | ICEBERG | DELTALAKE_S3 | FILE | SQL | HUBSPOT | ATHENA"},"secret":{"type":"string","description":"secret_id (prefer `connection_name` for public API calls)"},"connection_name":{"type":"string","minLength":1,"description":"name of the connection that contains the source table. Note: if the connection is renamed this value must be updated to match."},"name":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","description":"name of destination table in Evidence, if left blank we use source table name","example":"sales_all_regions"},"combine":{"type":"boolean","description":"(only for parquet sources) combine all parquet files into destination table"},"path":{"type":"string","description":"(only for parquet sources) path to parquet files to combine"}},"required":["id","source","type"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"message":{"type":"string","description":"message of the response"}},"required":["message"]},{"type":"object","properties":{"error":{"type":"string","description":"message of the response"}},"required":["error"]}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"This feature isn't available with your current permissions, upgrade your role","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/source":{"delete":{"summary":"Delete Source","tags":["Deploy"],"description":"Delete a source or model","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","description":"Table name","example":"sales_all_regions"},"isModel":{"type":"boolean","default":false,"description":"If source is a model (use delete model from models API)","deprecated":true,"example":true}}}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"204":{"description":"Data returning...","content":{"application/json":{"schema":{}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/sources/{name}":{"get":{"summary":"Get Source","tags":["Sources"],"description":"Look up a managed source by name, including its current deploy status. Pair with POST /v1/deploy/source: deploy returns a trace id, then poll this endpoint until deploy_status.status is COMPLETED or FAILED.","parameters":[{"schema":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","minLength":1,"maxLength":255,"example":"chats"},"in":"path","name":"name","required":true,"description":"destination table name (the `name` field used when the source was deployed)"}],"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Source found","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"destination table name in Evidence"},"connection_name":{"type":"string","description":"name of the connection this source belongs to"},"type":{"type":"string","description":"connection type, e.g. SQL | REDSHIFT | BIGQUERY"},"source":{"type":"string","description":"name of the table in the source system"},"path":{"type":"string","nullable":true,"description":"(parquet sources only) path to source files"},"combine":{"type":"boolean","nullable":true,"description":"(parquet sources only) combine multiple files into one table"},"deploy_status":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["NOT_STARTED"]},"deployTraceId":{"type":"string"}},"required":["status","deployTraceId"]},{"type":"object","properties":{"status":{"type":"string","enum":["IN_PROGRESS"]},"deployTraceId":{"type":"string"},"startedAt":{"type":"string"},"processedRows":{"type":"number"},"estimatedRows":{"type":"number"}},"required":["status","deployTraceId"]},{"type":"object","properties":{"status":{"type":"string","enum":["COMPLETED"]},"deployTraceId":{"type":"string"},"totalRows":{"type":"number"},"durationMs":{"type":"number"},"deployedAt":{"type":"string"},"wasSchemaRefreshed":{"type":"boolean"}},"required":["status","deployTraceId","totalRows","durationMs","deployedAt"]},{"type":"object","properties":{"status":{"type":"string","enum":["FAILED"]},"deployTraceId":{"type":"string"},"error":{"type":"string"},"failedAt":{"type":"string"},"durationMs":{"type":"number"}},"required":["status","deployTraceId","error","failedAt","durationMs"]}],"description":"current deploy state. Poll until status is COMPLETED or FAILED. FAILED carries an `error` string suitable for end-user display."},"created_at":{"type":"string","format":"date-time","description":"when the source was first registered"}},"required":["name","connection_name","type","source","path","combine","deploy_status","created_at"]}}}},"400":{"description":"Invalid path parameter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"message of the response"}},"required":["error"]}}}},"401":{"description":"This feature isn't available with your current permissions, upgrade your role","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"message of the response"}},"required":["error"]}}}},"404":{"description":"Source not found in caller's organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"message of the response"}},"required":["error"]}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/bootstrap":{"post":{"summary":"Create Workspace","tags":["Workspaces"],"description":"Create a data location and organization based on provided region. Not available in the API","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"region":{"type":"string","description":"Region in which to create the workspace","example":"us-central1"},"session":{"type":"string","minLength":100,"description":"Encrypted Session Cookie"}},"required":["region","session"]}}}},"security":[{"cookieAuth":[]}],"responses":{"201":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"message":{"type":"string","description":"Message","example":"Bootstrap successful"}},"required":["message"]},{"type":"object","properties":{"error":{"type":"string","description":"message of the response"}},"required":["error"]}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}},"501":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/rls":{"post":{"summary":"Create RLS Rule","tags":["RLS"],"description":"Create an RLS rule on one or more tables using SQL operator and a variable &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the RLS rule. Hyphens are stripped from the stored policy name; underscores are preserved.","example":"ae68dcc1713c4c4a8adafcb13364132d"},"variableKey":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":20,"description":"The user attribute key to be used in the RLS policy ","example":"region"},"operator":{"type":"string","enum":["=","!=",">",">=","<","<=","LIKE","ILIKE","NOT LIKE","IN","NOT IN"],"description":"Operator to enforce on the RLS rule"},"tables":{"type":"array","items":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","description":"Table name","example":"sales_all_regions"}},"column":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","description":"The column to apply the RLS policy on","example":"region_name"},"applyToAll":{"type":"boolean","default":true,"description":"Apply rule to all users in your org. on creation"},"isRestrictive":{"type":"boolean","default":false,"description":"Restrictive rules are applied cumulatively. For example, a row is available only if it matches both the region AND department filters"}},"required":["name","variableKey","operator","tables","column"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{}}}},"201":{"description":"Data returning...","content":{"application/json":{"schema":{}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Delete RLS Rule","tags":["RLS"],"description":"Delete rule on a table &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the RLS rule","example":"ae68dcc1713c4c4a8adafcb13364132d"},"table":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","description":"Table name","example":"sales_all_regions"}},"required":["name","table"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"204":{"description":"Data returning...","content":{"application/json":{"schema":{}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"get":{"summary":"List RLS Rules","tags":["RLS"],"description":"List all RLS in an Organization &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the RLS rule. Hyphens are stripped from the stored policy name; underscores are preserved.","example":"ae68dcc1713c4c4a8adafcb13364132d"},"variableKey":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":20,"description":"The user attribute key to be used in the RLS policy ","example":"region"},"operator":{"type":"string","enum":["=","!=",">",">=","<","<=","LIKE","ILIKE","NOT LIKE","IN","NOT IN"],"description":"Operator to enforce on the RLS rule"},"tables":{"type":"array","items":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","description":"Table name","example":"sales_all_regions"}},"column":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","description":"The column to apply the RLS policy on","example":"region_name"},"applyToAll":{"type":"boolean","default":true,"description":"Apply rule to all users in your org. on creation"},"isRestrictive":{"type":"boolean","default":false,"description":"Restrictive rules are applied cumulatively. For example, a row is available only if it matches both the region AND department filters"}},"required":["name","variableKey","operator","tables","column","applyToAll","isRestrictive"]}},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/rls/users":{"get":{"summary":"List Users","tags":["RLS Users"],"description":"List users and assigned variables &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","parameters":[{"schema":{"type":"string","default":"false","example":"true"},"in":"query","name":"withEmbedded","description":"Add embedded user to the list of user return"}],"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"description":"Id of the user","examples":["user_0123456","emb_0120912"]},"attributes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":20,"description":"The user attribute key to be used in the RLS policy ","example":"region"},"value":{"anyOf":[{"anyOf":[{"anyOf":[{"anyOf":[{"type":"string","pattern":"^(?!.*--)(?!.*[\\s;,'\"\\\\/#*]).*$","maxLength":90},{"type":"number"}]},{"type":"boolean"}]},{"type":"array","items":{"type":"string","pattern":"^(?!.*--)(?!.*[\\s;,'\"\\\\/#*]).*$"},"maxItems":90}]},{"type":"array","items":{"type":"number"}}],"description":"Attribute Value"}},"required":["key","value"]},"description":"Attributes of the user","example":[{"key":"country","value":"Canada"},{"key":"is_admin","value":true},{"key":"employee_id","value":11039},{"key":"user_duty","value":"%%%sale%%%"},{"key":"sales_region","value":["Canada","France"]},{"key":"allowed_ids","value":[3,1]}]}},"required":["userId","attributes"]}},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Save User Variable","tags":["RLS Users"],"description":"Create or update variable for a user &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"description":"Id of the user","example":"user_0123456"},"attribute":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":20,"description":"The user attribute key to be used in the RLS policy ","example":"region"},"value":{"anyOf":[{"anyOf":[{"anyOf":[{"anyOf":[{"type":"string","pattern":"^(?!.*--)(?!.*[\\s;,'\"\\\\/#*]).*$","maxLength":90},{"type":"number"}]},{"type":"boolean"}]},{"type":"array","items":{"type":"string","pattern":"^(?!.*--)(?!.*[\\s;,'\"\\\\/#*]).*$"},"maxItems":90}]},{"type":"array","items":{"type":"number"}}],"description":"Attribute Value"}},"required":["key","value"]}},"required":["userId","attribute"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"201":{"description":"Data returning...","content":{"application/json":{"schema":{}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Delete User Variable","tags":["RLS Users"],"description":"Delete variable for a user &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"description":"Id of the user","example":"user_0123456"},"key":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":20,"description":"The user attribute key to be used in the RLS policy ","example":"region"}},"required":["userId","key"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"204":{"description":"Data returning...","content":{"application/json":{"schema":{}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/users":{"get":{"summary":"List Platform Users","tags":["Workspace Users"],"description":"List the platform users of your organization, with their role and profile information &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"user id, normalized to the platform format","examples":["user_0123456","emb_0120912"],"example":"user_01M1H7ZAVJGZDPVNAWCBEAHY00"},"email":{"type":"string","format":"email","description":"Primary email of the user","example":"john.doe@example.com"},"firstName":{"type":"string","nullable":true,"description":"First name of the user, null if not set","example":"John"},"lastName":{"type":"string","nullable":true,"description":"Last name of the user, null if not set","example":"Doe"},"role":{"type":"string","nullable":true,"enum":["admin","viewer","external-viewer","org-viewer","developer","member",null],"description":"Role of the user in the organization","example":"admin"},"status":{"type":"string","enum":["active","pending","inactive"],"description":"Organization membership status of the user","example":"active"},"emailVerified":{"type":"boolean","description":"user email address is verified"},"createdAt":{"type":"string","description":"Creation date of the user (ISO 8601)","example":"2025-01-15T19:29:47.112Z"},"lastSignInAt":{"type":"string","nullable":true,"description":"Last sign in date of the user (ISO 8601), null if the user never signed in","example":"2025-02-01T19:29:47.112Z"}},"required":["id","email","firstName","lastName","role","status","emailVerified","createdAt","lastSignInAt"]},"description":"List of platform users of the organization"}},"required":["users"]},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/users/search":{"post":{"summary":"Search Platform Users","tags":["Workspace Users"],"description":"Search the platform users of your organization by email, case-insensitive, including fuzzy matches &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","minLength":1,"maxLength":254,"description":"Email (or partial email) to search for","example":"john.doe@example.com"}},"required":["email"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"user id, normalized to the platform format","examples":["user_0123456","emb_0120912"],"example":"user_01M1H7ZAVJGZDPVNAWCBEAHY00"},"email":{"type":"string","format":"email","description":"Primary email of the user","example":"john.doe@example.com"},"firstName":{"type":"string","nullable":true,"description":"First name of the user, null if not set","example":"John"},"lastName":{"type":"string","nullable":true,"description":"Last name of the user, null if not set","example":"Doe"},"role":{"type":"string","nullable":true,"enum":["admin","viewer","external-viewer","org-viewer","developer","member",null],"description":"Role of the user in the organization","example":"admin"},"status":{"type":"string","enum":["active","pending","inactive"],"description":"Organization membership status of the user","example":"active"},"emailVerified":{"type":"boolean","description":"user email address is verified"},"createdAt":{"type":"string","description":"Creation date of the user (ISO 8601)","example":"2025-01-15T19:29:47.112Z"},"lastSignInAt":{"type":"string","nullable":true,"description":"Last sign in date of the user (ISO 8601), null if the user never signed in","example":"2025-02-01T19:29:47.112Z"}},"required":["id","email","firstName","lastName","role","status","emailVerified","createdAt","lastSignInAt"]},"description":"List of platform users of the organization"}},"required":["users"]},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/rls/users/preview":{"post":{"summary":"Preview Rule","tags":["RLS Users"],"description":"Preview number of rows accessible to a user. <code>Admin</code> only &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"description":"Id of the user","example":"user_0123456"},"table":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","description":"Table name","example":"sales_all_regions"}},"required":["userId","table"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"rows":{"type":"object","properties":{"total":{"type":"number","minimum":0,"default":0,"description":"Total number of rows in table","example":10210},"accessible":{"type":"number","minimum":0,"default":0,"description":"Total number of accessible rows in table for target end user","example":93},"isOrgUser":{"type":"boolean","default":false,"description":"True if end user has no role therefore is using org. user by default it can read all tables","example":false}},"required":["total","accessible","isOrgUser"]}},"required":["rows"]},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/rls/variables":{"get":{"summary":"List Variables","tags":["Variables"],"description":"List variables and assigned users &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","parameters":[{"schema":{"type":"string","default":"false","example":"true"},"in":"query","name":"withEmbedded","description":"Add embedded user to the list of variables return"}],"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":20,"description":"The user attribute key to be used in the RLS policy ","example":"region"},"settings":{"type":"array","items":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Id of the user","examples":["user_0123456","emb_0120912"]}},"value":{"anyOf":[{"anyOf":[{"anyOf":[{"anyOf":[{"type":"string","pattern":"^(?!.*--)(?!.*[\\s;,'\"\\\\/#*]).*$","maxLength":90},{"type":"number"}]},{"type":"boolean"}]},{"type":"array","items":{"type":"string","pattern":"^(?!.*--)(?!.*[\\s;,'\"\\\\/#*]).*$"},"maxItems":90}]},{"type":"array","items":{"type":"number"}}],"description":"Attribute Value"}},"required":["userIds","value"]}}},"required":["key","settings"]},"description":"List of variables and users with the variable","example":[{"key":"employee_id","settings":[{"userIds":["user_1234","user_10299","emb_10291"],"value":1},{"userIds":["user_6789"],"value":2}]},{"key":"region","settings":[{"userIds":["user_1234","user_abc","emb_10101"],"value":"Canada"},{"userIds":["user_6789"],"value":"EU"}]}]},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/regions":{"get":{"summary":"Get All Regions","tags":["Region"],"description":"Get all regions supported in Evidence. Allowing to pick in which region you want to store your data","responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"region":{"type":"string","description":"cloud region where the data is stored"},"state":{"type":"string","description":"state where the data is stored"},"country":{"type":"string","description":"country where the data is stored"}},"required":["region","state","country"]}},{"type":"object","properties":{"error":{"type":"string","description":"message of the response"}},"required":["error"]}]}}}}}}},"/v1/profile":{"post":{"summary":"Get Profile","tags":["Profile"],"description":"Get profile info about current user","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session":{"type":"string","description":"session value, send empty string to use the session from the saved cookie","example":"ey..."},"withAttributes":{"type":"boolean","default":false,"description":"if true, the attributes will be returned","example":false}},"required":["session"]}}}},"security":[],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string","description":"user id","example":"user_1234567890"},"orgId":{"type":"string","description":"org id","example":"org_1234567890"},"role":{"type":"string","description":"user role","example":"admin"},"plan":{"type":"string","description":"user plan","example":"enterprise-tier"},"attributes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":20,"description":"The user attribute key to be used in the RLS policy ","example":"region"},"value":{"anyOf":[{"anyOf":[{"anyOf":[{"anyOf":[{"anyOf":[{"type":"string","maxLength":1000},{"type":"number"}]},{"type":"boolean"}]},{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100}]},{"type":"array","items":{"type":"number"}}]},{"type":"array","items":{"type":"boolean"}}],"description":"Attribute Value"}},"required":["key","value"]},"description":"user attributes","example":[{"key":"email","value":"test@example.com"}]},"bqRole":{"type":"string","description":"BigQuery role for native warehouse RLS","example":"sales_japan_team"}},"required":["userId","orgId","role","plan"]},{"type":"object","properties":{"error":{"type":"string","description":"message of the response"}},"required":["error"]}]}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"message of the response"}},"required":["error"]}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"message of the response"}},"required":["error"]}}}}}}},"/v1/auth/tokens":{"get":{"summary":"List Tokens","tags":["Tokens"],"description":"List tokens saved in your organization. Note that the key will not be accessible after creation&nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":3,"description":"Name of the API Key","example":"our_dashboard_integration"},"key":{"type":"string","description":"API key (only first 5 char)","example":"abcde"},"author":{"type":"string","description":"creator of the key","example":"user_123"},"orgId":{"type":"string","description":"Organization ID","example":"org_1234"},"createdAt":{"type":"string","description":"Date of creation","example":"2026-10-13T15:34:40.889Z"},"id":{"type":"string","pattern":"^[a-z0-9]([a-z0-9-]*[a-z0-9])?$","description":"id of the key","example":"1fabce05ba43d10a01074d453bb49543"}},"required":["name","key","author","orgId","createdAt","id"]}},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Create Token","tags":["Tokens"],"description":"Create a token to access the API programmatically for the current organization. Note that this will provide programmatic access to your organization's resources&nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","description":"Name of the key","example":"integration_custom_backend_v2"}},"required":["name"]}}}},"security":[{"cookieAuth":[]}],"responses":{"201":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","description":"API key","example":"abbbf34a9fec24ac1c8b669c0969c33a7d97836d88c6c624c850d19d0100fdea0be9876bb109a1f5e5b2e58c96b3ef8997d45256c110a15cf0fd31d364a786667"}},"required":["key"]},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Delete Token","tags":["Tokens"],"description":" Delete the tokens. Note that they will be permanently disabled with no recovery option&nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"string","pattern":"^[a-z0-9]([a-z0-9-]*[a-z0-9])?$","description":"id of the key","example":"1fabce05ba43d10a01074d453bb49543"}}},"description":"id of the key"},"security":[{"cookieAuth":[]}],"responses":{"204":{"description":"Data returning...","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/embedded":{"post":{"summary":"Create Session","tags":["Embedded"],"description":"Initializes an embedded session for the specified user. The system will provision a new user account if one does not exist and associate it with the provided variables. Set attribute values to <code>null</code> if they have been previously configured. Use <code>[]</code> for attribute if you want a user without attribute. The URL with nonce is only valid for 2 minutes. &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"maxLength":1000,"description":"An arbitrary unique string associated with the user/group. Passing a new value provisions a new user (which can take a few seconds) so reuse when the same data access is needed. For direct connectors with RLS support, pass the RLS role name","example":"ud_123456"},"pageId":{"type":"string","description":"Page ID can be found on the page settings","example":"5f732e9b-2d6a-49c5-b726-3870125d6abc"},"path":{"type":"string","description":"path to the page","example":"org_12345/my-project/home"},"ttl":{"type":"number","minimum":300,"maximum":604800,"description":"Time to live in seconds of the embedded session, min 5 minutes, max 7 days","default":86400},"attributes":{"type":"array","nullable":true,"items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":20,"description":"The user attribute key to be used in the RLS policy ","example":"region"},"value":{"anyOf":[{"anyOf":[{"anyOf":[{"anyOf":[{"anyOf":[{"type":"string","maxLength":1000},{"type":"number"}]},{"type":"boolean"}]},{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100}]},{"type":"array","items":{"type":"number"}}]},{"type":"array","items":{"type":"boolean"}}],"description":"Attribute Value"}},"required":["key","value"]},"description":"A list of variables and the users associated with each variable. These attributes can be integrated into the code page and retrieved using {{ $<KEY> }}.","example":[{"key":"employee_id","value":1102},{"key":"region","value":"Canada"},{"key":"departements","value":["Sales","Marketing"]},{"key":"zone_id","value":[193,992,19183]},{"key":"isAdmin","value":false}]},"cookieless":{"type":"boolean","default":true,"description":"Use false to store sessions as HTTP cookies. Defaults to true due to widespread third-party cookie blocking in modern browsers.","example":true},"testMode":{"type":"boolean","description":"Removes security on cookie. If you are working on localhost","example":true},"preventSessionShare":{"type":"boolean","description":"Restricts sessions to the original device and network to prevent unauthorized reuse (enabled by default)","default":true},"language":{"type":"string","enum":["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"],"description":"The language in which the dashboard content will be displayed","example":"fr"},"colorScheme":{"type":"string","enum":["light","dark"],"description":"Color scheme: 'light' (default when absent) or 'dark'","example":"dark"}},"required":["userId","pageId","path","attributes"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"201":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Embedded session URL, nonce URL: can only be used once","example":"https://evidence.studio/v1/embedded/bdadopkef508ac25a870c27b0d9425d689kwofasokp12i90iowjdiom"}},"required":["url"]},{}]}}}},"400":{"description":{"error":"Request is invalid"},"content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/embedded/{nonce}":{"get":{"summary":"Get Report","tags":["Embedded"],"description":"Loads an embedded session and returns the associated page. A set-cookie header containing the embedded session for the user is included in the response. In cookieless mode, the JWE is passed as a search parameter instead. &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","security":[],"parameters":[{"schema":{"type":"string"},"in":"path","name":"nonce","required":true}],"responses":{"201":{"description":"Data returning...","content":{"application/json":{"schema":{}}}},"302":{"description":"Redirect to the page associated with the embedded session","content":{"application/json":{"schema":{}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/embedded/bigquery":{"post":{"summary":"Create BigQuery Session","tags":["Embedded"],"description":"Initializes an embedded session for BigQuery native warehouse. Two modes: (1) If bqRole is sent, it must match a role configured in org settings warehouse.bigqueryConfig.roles — the studio frontend will impersonate the matching service account. (2) If bqRole is omitted, userId must be a member of the org (validated via WorkOS). The URL with nonce is only valid for 2 minutes. &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"maxLength":1000,"description":"An arbitrary unique string associated with the user/group. Passing a new value provisions a new user (which can take a few seconds) so reuse when the same data access is needed. For direct connectors with RLS support, pass the RLS role name","example":"ud_123456"},"pageId":{"type":"string","description":"Page ID can be found on the page settings","example":"5f732e9b-2d6a-49c5-b726-3870125d6abc"},"path":{"type":"string","description":"path to the page","example":"org_12345/my-project/home"},"ttl":{"type":"number","minimum":300,"maximum":604800,"description":"Time to live in seconds of the embedded session, min 5 minutes, max 7 days","default":86400},"attributes":{"type":"array","nullable":true,"items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":20,"description":"The user attribute key to be used in the RLS policy ","example":"region"},"value":{"anyOf":[{"anyOf":[{"anyOf":[{"anyOf":[{"anyOf":[{"type":"string","maxLength":1000},{"type":"number"}]},{"type":"boolean"}]},{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100}]},{"type":"array","items":{"type":"number"}}]},{"type":"array","items":{"type":"boolean"}}],"description":"Attribute Value"}},"required":["key","value"]},"description":"A list of variables and the users associated with each variable. These attributes can be integrated into the code page and retrieved using {{ $<KEY> }}.","example":[{"key":"employee_id","value":1102},{"key":"region","value":"Canada"},{"key":"departements","value":["Sales","Marketing"]},{"key":"zone_id","value":[193,992,19183]},{"key":"isAdmin","value":false}]},"cookieless":{"type":"boolean","default":true,"description":"Use false to store sessions as HTTP cookies. Defaults to true due to widespread third-party cookie blocking in modern browsers.","example":true},"testMode":{"type":"boolean","description":"Removes security on cookie. If you are working on localhost","example":true},"preventSessionShare":{"type":"boolean","description":"Restricts sessions to the original device and network to prevent unauthorized reuse (enabled by default)","default":true},"language":{"type":"string","enum":["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"],"description":"The language in which the dashboard content will be displayed","example":"fr"},"colorScheme":{"type":"string","enum":["light","dark"],"description":"Color scheme: 'light' (default when absent) or 'dark'","example":"dark"},"bqRole":{"type":"string","description":"The BigQuery role name must match a role defined in your access rules. When a BQ role is provided, the userId field can be empty or set to any value.","example":"sales_team_japan"}},"required":["userId","pageId","path","attributes"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"201":{"description":"Data returning...","content":{"application/json":{"schema":{}}}},"400":{"description":{"error":"Request is invalid"},"content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/analytics/access":{"put":{"summary":"Enable Usage Analytics","tags":["Analytics"],"description":"Grant usage analytics access for an organization (Enterprise only)","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Analytics access granted","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"rolesUpdated":{"type":"number"}},"required":["enabled","rolesUpdated"]}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Disable Usage Analytics","tags":["Analytics"],"description":"Revoke usage analytics access for an organization (Enterprise only)","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Analytics access revoked","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"rolesUpdated":{"type":"number"}},"required":["enabled","rolesUpdated"]}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/models":{"post":{"summary":"Save Model","tags":["Models"],"description":"Save a model from your sources &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Id of the model to save for existing model","example":"models_<uuid>"},"name":{"type":"string","pattern":"^[a-zA-Z0-9_]+$","maxLength":255,"description":"Name of the model","example":"our_new_model"},"query":{"type":"string","description":"Query of the model","example":"select * from demo_daily_orders;"},"description":{"type":"string","description":"Description of the model","example":"This is a description of our new model."},"validationQueryHash":{"type":"string","description":"query hash from  <a href=\"/#tag/models/POST/v1/workspaces/models/validate\">validation endpoint</a>","example":"aead1234567890"},"refreshIntervalHours":{"type":"number","minimum":1,"maximum":72,"default":24,"description":"The interval in hours to refresh the model","example":12},"engine":{"type":"string","enum":["S3","MergeTree","SummingMergeTree","AggregatingMergeTree"],"default":"S3","description":"Engine to build the model. <b>Available Engines:</b> <br/><br/><b>S3</b>: Stores data in bucket | Data stored in region of your organization<br/><br/><b>MergeTree</b>: General-purpose table. Faster than the default engine. | Data stored in GCP us-central1<br/><br/><b>SummingMergeTree</b>: Pre-aggregated counters or running totals — things like daily page view counts, revenue by region, or click counters | Data stored in GCP us-central1<br/><br/><b>AggregatingMergeTree</b>: You need incremental, pre-computed aggregations more complex than simple sums (e.g. unique user counts, averages, or quantiles) | Data stored in GCP us-central1<br/><br/>","example":"MergeTree"},"primaryKey":{"type":"string","nullable":true,"default":null,"description":"Required for the MergeTree engine: MergeTree, AggregatingMergeTree... ","example":"sales_dept"}},"required":["name","query","description","validationQueryHash"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"201":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"Name of the model","example":"our_new_model"}},"required":["name"]},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"get":{"summary":"List Models","tags":["Models"],"description":"List models &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","parameters":[{"schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":255,"example":"our_new_model"},"in":"query","name":"name","description":"Name of the model; skip to get all models"},{"schema":{"type":"string","example":"models_<uuid>"},"in":"query","name":"id","description":"Id of the model to save for existing model"},{"schema":{"type":"string","enum":["true","false"],"example":"true"},"in":"query","name":"force","description":"Force new metadata fetch of the models"}],"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"uuid of the model","example":"1111-2222-3333-4444"},"name":{"type":"string","description":"Name of the model","example":"our_new_model"},"description":{"type":"string","description":"Model description","example":"Show sales per month"},"createdBy":{"type":"string","description":"User Id of the model creator","example":"user_id_1234567"},"updatedBy":{"type":"string","description":"User id of the last user that update the model","example":"user_id_123"},"schedule":{"type":"number","description":"Refresh at each X hours","example":12},"createdAt":{"type":"string","description":"Model creation date","example":"2023-07-05Z10:10T"},"updatedAt":{"type":"string","description":"Model last update by a member of your team","example":"2023-07-05Z10:10T"},"query":{"type":"string","description":"Query used to create the model","example":"SELECT * FROM table"},"status":{"type":"string","enum":["SUCCESS","ERROR","IN_PROGRESS"],"description":"status of the model refresh job","example":"SUCCESS"},"exportDurationMS":{"type":"number","minimum":0,"description":"Time it takes to refresh the model (ms)","example":1000},"lastSuccessExport":{"type":"string","description":"Date of the last successful export","example":"2021-01-01T00:00:00Z"},"lastRefreshTime":{"type":"string","description":"Date of the last refresh","example":"2021-01-01T00:00:00Z"},"nextRefreshTime":{"type":"string","description":"Date of the next refresh","example":"2021-01-02T02:02:00Z"},"error":{"type":"string","nullable":true,"default":null,"description":"Error encounter in the model creation","example":"DB::Exception: Identifier 'sales.rep' cannot be resolved from table with name sales."},"engine":{"type":"string","enum":["S3","MergeTree","SummingMergeTree","AggregatingMergeTree"],"default":"S3","description":"Table Engine used by the model","example":"S3"},"primaryKey":{"type":"string","nullable":true,"default":null,"description":"Required if for MergeTree engine: MergeTree, AggregatingMergeTree... ","example":"sales_dept"}},"required":["id","name","description","createdBy","schedule","createdAt","updatedAt","query","status","exportDurationMS","lastSuccessExport","lastRefreshTime","nextRefreshTime","error","engine","primaryKey"]},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Delete Model","tags":["Models"],"description":"Delete a model &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Id of the model to save for existing model","example":"models_<uuid>"}},"required":["id"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"204":{"description":"Data returning...","content":{"application/json":{"schema":{}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"404":{"description":{"error":"Not found"},"content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/models/refresh":{"post":{"summary":"Refresh Model","tags":["Models"],"description":"Refresh model data &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","maxLength":255,"description":"Name of the model","example":"our_new_model"}},"required":["name"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/models/names":{"get":{"summary":"Get Model Names","tags":["Models"],"description":"Return models names","security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"Returns only the name of the current model","example":["model_1","model_2"]},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/models/validate":{"post":{"summary":"Validate","tags":["Models"],"description":"Validate a model from your query &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9_]+$","maxLength":255,"description":"Name of the model","example":"our_new_model"},"query":{"type":"string","description":"Query of the model","example":"select * from demo_daily_orders;"},"engine":{"type":"string","enum":["S3","MergeTree","SummingMergeTree","AggregatingMergeTree"],"default":"S3","description":"Engine to build the model. <b>Available Engines:</b> <br/><br/><b>S3</b>: Stores data in bucket | Data stored in region of your organization<br/><br/><b>MergeTree</b>: General-purpose table. Faster than the default engine. | Data stored in GCP us-central1<br/><br/><b>SummingMergeTree</b>: Pre-aggregated counters or running totals — things like daily page view counts, revenue by region, or click counters | Data stored in GCP us-central1<br/><br/><b>AggregatingMergeTree</b>: You need incremental, pre-computed aggregations more complex than simple sums (e.g. unique user counts, averages, or quantiles) | Data stored in GCP us-central1<br/><br/>","example":"MergeTree"},"primaryKey":{"type":"string","nullable":true,"default":null,"description":"Required if for MergeTree engine: MergeTree, AggregatingMergeTree... ","example":"sales_dept"}},"required":["name","query"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"Name of the model","example":"our_new_model"},"stats":{"type":"object","properties":{"rows":{"type":"number","description":"Number of rows read by query","example":1000},"bytes":{"type":"number","description":"Number of bytes read by query","example":1000}},"required":["rows","bytes"],"description":"Stats of the query","example":{"rows":1000,"bytes":1000}},"queryHash":{"type":"string","description":"Hash of the query","example":"aead1234567890"},"query":{"type":"string","description":"original query","example":"SELECT * FROM table"},"engine":{"type":"string","enum":["S3","MergeTree","SummingMergeTree","AggregatingMergeTree"],"default":"S3","description":"Engine to build the model. <b>Available Engines:</b> <br/><br/><b>S3</b>: Stores data in bucket | Data stored in region of your organization<br/><br/><b>MergeTree</b>: General-purpose table. Faster than the default engine. | Data stored in GCP us-central1<br/><br/><b>SummingMergeTree</b>: Pre-aggregated counters or running totals — things like daily page view counts, revenue by region, or click counters | Data stored in GCP us-central1<br/><br/><b>AggregatingMergeTree</b>: You need incremental, pre-computed aggregations more complex than simple sums (e.g. unique user counts, averages, or quantiles) | Data stored in GCP us-central1<br/><br/>","example":"MergeTree"},"primaryKey":{"type":"string","nullable":true,"default":null,"description":"Required if for MergeTree engine: MergeTree, AggregatingMergeTree... ","example":"sales_dept"}},"required":["name","stats","queryHash","query","engine","primaryKey"]},{}]}}}},"204":{"description":"Query works but does not return any data","content":{"application/json":{"schema":{}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"412":{"description":"Query is invalid","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/models/engines":{"get":{"summary":"List Models Engines","tags":["Models"],"description":"List Models Engines","security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","enum":["S3","MergeTree","SummingMergeTree","AggregatingMergeTree"]},"meta":{"description":"Metadata of the Engine","example":{"description":"General-purpose table. Faster than the default engine.","dataLocation":"GCP us-central1","reference":"https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree"}}},"required":["name"]}},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/schemas/connectors/{name}/schema.json":{"get":{"summary":"Get a connector schemas","tags":["Schemas"],"description":"Connector Schemas","parameters":[{"schema":{"type":"string","enum":["motherduck","sql","bigquery","snowflake","flat","athena"]},"in":"path","name":"name","required":true,"description":"Connector name"}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object"},{"type":"object","properties":{"error":{"type":"string","description":"message of the response"}},"required":["error"]}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/apt/token":{"post":{"summary":"Create Access Token","tags":["Access Token"],"description":"Create an Access Token for the current organization. Access Tokens enable programmatic access to the query engine and analytics API. Supports optional user impersonation (admin/dev only) and configurable TTL (5 min – 2 years, default 24h). This token grants access to your organization's data and resources.&nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"impersonate":{"type":"object","nullable":true,"properties":{"email":{"type":"string","format":"email","description":"The email of the user to impersonate","example":"joe@mail.com"},"userId":{"type":"string","minLength":1,"description":"Id of the user","example":"user_0123456"}},"required":["email","userId"],"default":null,"description":"optional only for impersonate feature"},"language":{"type":"string","enum":["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"],"description":"The language in which the dashboard content will be displayed","example":"fr"},"colorScheme":{"type":"string","enum":["light","dark"],"description":"Color scheme: 'light' (default when absent) or 'dark'","example":"dark"},"name":{"type":"string","description":"name for your token"},"hostname":{"type":"string","description":"CLI token hostname"},"description":{"type":"string","description":"description for your token"},"ttl":{"type":"number","minimum":300,"maximum":63072000,"description":"Time to live in seconds of the APT session, min 5 minutes, max 2 years","default":86400}}}}}},"security":[{"cookieAuth":[]}],"responses":{"201":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"token":{"type":"string","description":"Generated Token","example":"Eys29a..."}},"required":["token"]},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"get":{"summary":"List APT Tokens","tags":["Access Token"],"description":"List Access Tokens for the current organization. Org admins see all tokens; non-admins see only tokens they created. Expired tokens are automatically removed from results. The raw token value cannot be retrieved after creation.&nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"tokenHash":{"type":"string","description":"Hashed token identifier"},"organizationId":{"type":"string","description":"Organization the token belongs to"},"userId":{"type":"string","description":"User the token is associated with"},"name":{"type":"string","description":"Token name"},"description":{"type":"string","description":"Token description"},"author":{"type":"string","description":"User who created the token"},"tokenName":{"type":"string","description":"Token display name"},"impersonate":{"type":"boolean","description":"Whether the token can impersonate"},"isActive":{"type":"boolean","description":"Whether the token is active"},"createdAt":{"type":"string","description":"Creation timestamp"},"updatedAt":{"type":"string","description":"Last update timestamp"},"expiration":{"type":"string","description":"Date of Expiration (ISO)"},"role":{"type":"string","enum":["admin","viewer","external-viewer","org-viewer","developer","member"],"description":"role attach to token","example":"viewer"},"language":{"type":"string","enum":["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"],"description":"The language in which the dashboard content will be displayed","example":"fr"},"colorScheme":{"type":"string","enum":["light","dark"],"description":"Color scheme: 'light' (default when absent) or 'dark'","example":"dark"},"hostname":{"type":"string","nullable":true,"description":"CLI token hostname"}},"required":["tokenHash","organizationId","userId","name","author","tokenName","impersonate","isActive","createdAt","updatedAt","expiration","role","hostname"]},"description":"List of APT tokens"},{}]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Delete Access Token","tags":["Access Token"],"description":"Revoke an Access Token. This permanently invalidates the token with no recovery option. Org admins can revoke any token in their organization; non-admins can only revoke tokens they created.&nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tokenHash":{"type":"string","description":"Hashed identifier of the token to delete"}},"required":["tokenHash"]}}}},"security":[{"cookieAuth":[]}],"responses":{"204":{"description":"Data returning...","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/report/run":{"post":{"summary":"Run a report","tags":["Reports"],"description":"Create one off report PDF and send to target users&nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"Name of report","example":"Our Sales"},"fileName":{"type":"string","maxLength":255,"description":"Name of the file sent: <name>.pdf","example":"sales_eport_2022.pdf"},"email":{"type":"object","properties":{"subject":{"type":"string","maxLength":255,"description":"Email subject"},"targetUserIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Id of the user","example":"user_0123456"},"maxItems":50,"description":"All target user ids to send the runtime report, user id can be found in team page"},"commentary":{"type":"object","properties":{"body":{"type":"string","maxLength":4096}},"required":["body"],"description":"Add a comment to the report sent by email"},"html":{"type":"string","maxLength":262144,"description":"Base64-encoded custom HTML email body (max 256KB). If provided, replaces the default template entirely."}},"required":["subject"],"description":"Email configuration","example":{"subject":"My report","targetUserIds":["user_01J990NKR0P9788V8Z7C4TTYAA","user_02J980NKR0P0788VKZ7C4TTYAA"],"commentary":{"body":"Hi this is our report!"}}},"language":{"type":"string","enum":["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"],"description":"The language in which the dashboard content will be displayed","example":"fr"},"url":{"type":"string","description":"Format: /{orgId}/{projectSlug}/{pagePath}","example":"/org_123/my-project/home"},"branch":{"type":"string","description":"Git branch to render. Defaults to main if omitted or empty.","example":"new_feature_one","default":"main"},"format":{"type":"object","properties":{"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation","default":"portrait"},"marginTop":{"type":"string","description":"Top margin","example":"20"},"marginRight":{"type":"string","description":"Right margin","example":"20"},"marginBottom":{"type":"string","description":"Bottom margin","example":"20"},"marginLeft":{"type":"string","description":"Left margin","example":"20"},"cards":{"type":"boolean","description":"Show cards in PDF","example":true},"usePageColors":{"type":"boolean","description":"Preserve the page's exact theme background colors instead of forcing white"},"colorScheme":{"type":"string","enum":["light","dark"],"description":"Color scheme: 'light' (default when absent) or 'dark'","example":"dark"},"hiddenSections":{"type":"array","items":{"type":"string"},"description":"Section IDs to hide"},"version":{"type":"string","enum":["working","committed"],"description":"Which version to render","default":"committed"}},"description":"PDF formatting options"},"renderMode":{"type":"string","enum":["shared","perRecipient"],"description":"Render mode: 'shared' (one runtime user's view for all) or 'perRecipient' (each recipient gets their own view)","default":"shared"},"runtimeUserId":{"type":"string","minLength":1,"description":"User that will be used to generate the report. Required if render mode is: shared ","example":"user_0123456"},"recipientSource":{"type":"string","enum":["users","slack"],"description":"Source of recipients","default":"users","example":"users"},"recipientGroupIds":{"type":"array","nullable":true,"items":{"type":"string","description":"Group id","example":"group_1234"}},"slack":{"type":"object","properties":{"channelId":{"type":"string","description":"Slack channel ID to post"},"message":{"type":"string","maxLength":4000,"description":"text message"}},"required":["channelId"],"description":"Slack delivery config. When present, the rendered PDF is posted to the given Slack channel instead of being emailed. enforce a shared render mode.","example":{"channelId":"29182","message":"Hello this is our Q2 report"}}},"required":["name","fileName","url"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"201":{"description":"Data returning...","content":{"application/json":{"schema":{"type":"object","properties":{"workflowId":{"type":"string","description":"First workflow ID (kept for backward compatibility). Prefer workflowIds for multi-recipient runs."},"workflowIds":{"type":"array","items":{"type":"string"},"description":"All workflow IDs started (one per recipient in perRecipient mode)"},"reportRunIds":{"type":"array","items":{"type":"string"},"description":"All report_runs row IDs created (one per recipient in perRecipient mode)"}},"required":["workflowIds","reportRunIds"]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/report/runs":{"get":{"summary":"List Report Runs","tags":["Reports"],"description":"List report run history for the organization","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100,"default":100},"in":"query","name":"limit","description":"Number of runs to return (1-100, default 100)"},{"schema":{"type":"number","minimum":0,"default":0},"in":"query","name":"offset","description":"Offset for pagination"},{"schema":{"type":"string"},"in":"query","name":"name","description":"Filter by report name (exact match)"},{"schema":{"type":"string"},"in":"query","name":"id","description":"Filter by report schedule ID"}],"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"List of report runs with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Run ID"},"organizationId":{"type":"string","description":"Organization ID"},"status":{"type":"string","enum":["failed","pending","running","succeeded"],"default":"pending","description":"Run status"},"triggerKind":{"type":"string","description":"Trigger kind"},"authorUserId":{"type":"string","description":"Author user ID"},"runtimeUserId":{"type":"string","description":"Runtime user ID"},"emailTargetUserIds":{"type":"array","items":{"type":"string"},"description":"Email target user IDs"},"name":{"type":"string","description":"Report name"},"fileName":{"type":"string","description":"PDF filename"},"emailSubject":{"type":"string","description":"Email subject"},"language":{"type":"string","nullable":true,"description":"Language code"},"format":{"type":"object","nullable":true,"properties":{"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation","default":"portrait"},"marginTop":{"type":"string","description":"Top margin","example":"20"},"marginRight":{"type":"string","description":"Right margin","example":"20"},"marginBottom":{"type":"string","description":"Bottom margin","example":"20"},"marginLeft":{"type":"string","description":"Left margin","example":"20"},"cards":{"type":"boolean","description":"Show cards in PDF","example":true},"usePageColors":{"type":"boolean","description":"Preserve the page's exact theme background colors instead of forcing white"},"colorScheme":{"type":"string","enum":["light","dark"],"description":"Color scheme: 'light' (default when absent) or 'dark'","example":"dark"},"hiddenSections":{"type":"array","items":{"type":"string"},"description":"Section IDs to hide"},"version":{"type":"string","enum":["working","committed"],"description":"Which version to render","default":"committed"}},"description":"PDF format"},"recipientResults":{"nullable":true,"anyOf":[{"type":"array","items":{"type":"object","properties":{"recipient":{"type":"string","description":"Recipient email address"},"messageId":{"type":"string","description":"Resend message ID for this recipient"},"error":{"type":"string","description":"Error message if send failed"},"status":{"type":"string","enum":["sent","failed"],"description":"Send status for this recipient"}},"required":["recipient","status"]}},{"type":"object","properties":{"renderError":{"type":"string","description":"Error message from the failed PDF render"}},"required":["renderError"]}],"description":"Recipient results (array of email send results, or render error object)"},"deliveryType":{"type":"string","enum":["email","slack"],"description":"Delivery destination: 'email' or 'slack'"},"slackChannelId":{"type":"string","nullable":true,"description":"Slack channel ID"},"slackMessageTs":{"type":"string","nullable":true,"description":"Slack message timestamp once posted"},"slackError":{"type":"string","nullable":true,"maxLength":1000,"description":"Slack delivery error if failed"},"startedAt":{"type":"string","description":"Started at"},"completedAt":{"type":"string","nullable":true,"description":"Completed at"},"createdAt":{"type":"string","description":"Created at"},"updatedAt":{"type":"string","description":"Updated at"},"branch":{"type":"string","description":"Git branch"},"scheduleId":{"type":"string","nullable":true,"description":"Originating schedule ID"}},"required":["id","organizationId","status","triggerKind","authorUserId","runtimeUserId","emailTargetUserIds","name","fileName","emailSubject","deliveryType","startedAt","createdAt","updatedAt","branch"]}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"total":{"type":"number"}},"required":["limit","offset","total"]}},"required":["runs","pagination"]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/report/schedules":{"post":{"summary":"Save Report Schedule","tags":["Reports"],"description":"Create or update a scheduled report&nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Schedule ID. Omit to create a new schedule; provide to update an existing one.","example":"report_sched_0100A9B9BABD90RZSSZAJ9AJA0"},"name":{"type":"string","maxLength":255,"description":"Report name","example":"Weekly Sales"},"fileName":{"type":"string","maxLength":255,"description":"PDF filename","example":"sales-report.pdf"},"url":{"type":"string","description":"Published page URL (without branch or /pdf/ segment). Format: /{orgId}/{projectSlug}/{pagePath}","example":"/org_123/my-project/home"},"branch":{"type":"string","default":"main","description":"Git branch to render. Defaults to 'main' if omitted or empty.","example":"main"},"emailSubject":{"type":"string","maxLength":255,"description":"Email subject"},"emailCommentaryBody":{"type":"string","maxLength":4096,"description":"Commentary body"},"emailCustomHtml":{"type":"string","maxLength":262144,"description":"Base64-encoded custom HTML"},"language":{"type":"string","enum":["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"],"description":"The language in which the dashboard content will be displayed","example":"fr"},"format":{"type":"object","properties":{"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation","default":"portrait"},"marginTop":{"type":"string","description":"Top margin","example":"20"},"marginRight":{"type":"string","description":"Right margin","example":"20"},"marginBottom":{"type":"string","description":"Bottom margin","example":"20"},"marginLeft":{"type":"string","description":"Left margin","example":"20"},"cards":{"type":"boolean","description":"Show cards in PDF","example":true},"usePageColors":{"type":"boolean","description":"Preserve the page's exact theme background colors instead of forcing white"},"colorScheme":{"type":"string","enum":["light","dark"],"description":"Color scheme: 'light' (default when absent) or 'dark'","example":"dark"},"hiddenSections":{"type":"array","items":{"type":"string"},"description":"Section IDs to hide"},"version":{"type":"string","enum":["working","committed"],"description":"Which version to render","default":"committed"}}},"renderMode":{"type":"string","enum":["shared","perRecipient"],"description":"Render mode: 'shared' (one runtime user's view for all) or 'perRecipient' (each recipient gets their own view)","default":"shared"},"runtimeUserId":{"type":"string","minLength":1,"description":"Required when renderMode='shared'; ignored when 'perRecipient'","example":"user_0123456"},"recipientSource":{"type":"string","enum":["users","slack"],"description":"Source of recipients","default":"users","example":"users"},"recipientUserIds":{"type":"array","items":{"type":"string","minLength":1,"description":"Id of the user","example":"user_0123456"},"description":"List of user to send to"},"recipientGroupIds":{"type":"array","nullable":true,"items":{"type":"string","description":"Send to one or more group","example":"group_1234"}},"recipientEmails":{"type":"array","items":{"type":"string","format":"email"},"description":"List of external emails to send report (BETA)"},"slackChannelId":{"type":"string","description":"Slack channel Id"},"slackMessage":{"type":"string","maxLength":4000,"description":"Slack message text"},"cron":{"type":"string","description":"Cron expression","example":"0 9 * * *"},"timezone":{"type":"string","default":"UTC","description":"IANA timezone","example":"America/New_York"},"isCustomCron":{"type":"boolean","default":false},"paused":{"type":"boolean","default":false}},"required":["name","fileName","url","emailSubject","cron"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Schedule updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Schedule ID"},"organizationId":{"type":"string","description":"Organization ID"},"authorUserId":{"type":"string","description":"Author user ID"},"name":{"type":"string","description":"Report name"},"fileName":{"type":"string","description":"PDF filename"},"url":{"type":"string","description":"Published page URL"},"emailSubject":{"type":"string","description":"Email subject"},"emailCommentaryBody":{"type":"string","nullable":true,"description":"Commentary body"},"emailCustomHtml":{"type":"string","nullable":true,"description":"Base64-encoded custom HTML"},"language":{"type":"string","nullable":true,"enum":["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu",null],"description":"The language in which the dashboard content will be displayed","example":"fr"},"format":{"type":"object","nullable":true,"properties":{"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation","default":"portrait"},"marginTop":{"type":"string","description":"Top margin","example":"20"},"marginRight":{"type":"string","description":"Right margin","example":"20"},"marginBottom":{"type":"string","description":"Bottom margin","example":"20"},"marginLeft":{"type":"string","description":"Left margin","example":"20"},"cards":{"type":"boolean","description":"Show cards in PDF","example":true},"usePageColors":{"type":"boolean","description":"Preserve the page's exact theme background colors instead of forcing white"},"colorScheme":{"type":"string","enum":["light","dark"],"description":"Color scheme: 'light' (default when absent) or 'dark'","example":"dark"},"hiddenSections":{"type":"array","items":{"type":"string"},"description":"Section IDs to hide"},"version":{"type":"string","enum":["working","committed"],"description":"Which version to render","default":"committed"}}},"renderMode":{"type":"string","enum":["shared","perRecipient"],"description":"Render mode"},"runtimeUserId":{"type":"string","nullable":true,"minLength":1,"description":"Runtime user ID","examples":["user_0123456","emb_0120912"]},"recipientSource":{"type":"string","enum":["users","slack"],"description":"Recipient source"},"recipientUserIds":{"type":"array","nullable":true,"items":{"type":"string","minLength":1,"description":"Id of the user","examples":["user_0123456","emb_0120912"]},"description":"Recipient user IDs"},"recipientGroupIds":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Recipient group IDs"},"recipientEmails":{"type":"array","nullable":true,"items":{"type":"string","format":"email"},"description":"Recipient emails"},"slackChannelId":{"type":"string","nullable":true,"description":"Slack channel ID"},"slackMessage":{"type":"string","nullable":true,"description":"Slack message text"},"cron":{"type":"string","description":"Cron expression"},"timezone":{"type":"string","description":"IANA timezone"},"isCustomCron":{"type":"boolean","description":"Whether using custom cron"},"paused":{"type":"boolean","description":"Whether schedule is paused"},"lastRunStartedAt":{"type":"string","nullable":true,"description":"Last run started at"},"startNextRunAt":{"type":"string","description":"Next run scheduled at"},"createdAt":{"type":"string","description":"Created at"},"updatedAt":{"type":"string","description":"Updated at"},"branch":{"type":"string","description":"Git branch"}},"required":["id","organizationId","authorUserId","name","fileName","url","emailSubject","renderMode","recipientSource","cron","timezone","isCustomCron","paused","startNextRunAt","createdAt","updatedAt","branch"]}}}},"201":{"description":"Schedule created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Schedule ID"},"organizationId":{"type":"string","description":"Organization ID"},"authorUserId":{"type":"string","description":"Author user ID"},"name":{"type":"string","description":"Report name"},"fileName":{"type":"string","description":"PDF filename"},"url":{"type":"string","description":"Published page URL"},"emailSubject":{"type":"string","description":"Email subject"},"emailCommentaryBody":{"type":"string","nullable":true,"description":"Commentary body"},"emailCustomHtml":{"type":"string","nullable":true,"description":"Base64-encoded custom HTML"},"language":{"type":"string","nullable":true,"enum":["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu",null],"description":"The language in which the dashboard content will be displayed","example":"fr"},"format":{"type":"object","nullable":true,"properties":{"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation","default":"portrait"},"marginTop":{"type":"string","description":"Top margin","example":"20"},"marginRight":{"type":"string","description":"Right margin","example":"20"},"marginBottom":{"type":"string","description":"Bottom margin","example":"20"},"marginLeft":{"type":"string","description":"Left margin","example":"20"},"cards":{"type":"boolean","description":"Show cards in PDF","example":true},"usePageColors":{"type":"boolean","description":"Preserve the page's exact theme background colors instead of forcing white"},"colorScheme":{"type":"string","enum":["light","dark"],"description":"Color scheme: 'light' (default when absent) or 'dark'","example":"dark"},"hiddenSections":{"type":"array","items":{"type":"string"},"description":"Section IDs to hide"},"version":{"type":"string","enum":["working","committed"],"description":"Which version to render","default":"committed"}}},"renderMode":{"type":"string","enum":["shared","perRecipient"],"description":"Render mode"},"runtimeUserId":{"type":"string","nullable":true,"minLength":1,"description":"Runtime user ID","examples":["user_0123456","emb_0120912"]},"recipientSource":{"type":"string","enum":["users","slack"],"description":"Recipient source"},"recipientUserIds":{"type":"array","nullable":true,"items":{"type":"string","minLength":1,"description":"Id of the user","examples":["user_0123456","emb_0120912"]},"description":"Recipient user IDs"},"recipientGroupIds":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Recipient group IDs"},"recipientEmails":{"type":"array","nullable":true,"items":{"type":"string","format":"email"},"description":"Recipient emails"},"slackChannelId":{"type":"string","nullable":true,"description":"Slack channel ID"},"slackMessage":{"type":"string","nullable":true,"description":"Slack message text"},"cron":{"type":"string","description":"Cron expression"},"timezone":{"type":"string","description":"IANA timezone"},"isCustomCron":{"type":"boolean","description":"Whether using custom cron"},"paused":{"type":"boolean","description":"Whether schedule is paused"},"lastRunStartedAt":{"type":"string","nullable":true,"description":"Last run started at"},"startNextRunAt":{"type":"string","description":"Next run scheduled at"},"createdAt":{"type":"string","description":"Created at"},"updatedAt":{"type":"string","description":"Updated at"},"branch":{"type":"string","description":"Git branch"}},"required":["id","organizationId","authorUserId","name","fileName","url","emailSubject","renderMode","recipientSource","cron","timezone","isCustomCron","paused","startNextRunAt","createdAt","updatedAt","branch"]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"get":{"summary":"List Report Schedules","tags":["Reports"],"description":"List report schedules for the organization","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100,"default":100},"in":"query","name":"limit","description":"Number of schedules to return (1-100, default 100)"},{"schema":{"type":"number","minimum":0,"default":0},"in":"query","name":"offset","description":"Offset for pagination"},{"schema":{"type":"string","example":"my_report"},"in":"query","name":"name","description":"Filter by report name"},{"schema":{"type":"string","example":"report_sched_0100A9B9BABD90RZSSZAJ9AJA0"},"in":"query","name":"id","description":"Filter by a specific schedule Id"}],"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"List of schedules with pagination metadata","content":{"application/json":{"schema":{"type":"object","properties":{"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Schedule ID"},"organizationId":{"type":"string","description":"Organization ID"},"authorUserId":{"type":"string","description":"Author user ID"},"name":{"type":"string","description":"Report name"},"fileName":{"type":"string","description":"PDF filename"},"url":{"type":"string","description":"Published page URL"},"emailSubject":{"type":"string","description":"Email subject"},"emailCommentaryBody":{"type":"string","nullable":true,"description":"Commentary body"},"emailCustomHtml":{"type":"string","nullable":true,"description":"Base64-encoded custom HTML"},"language":{"type":"string","nullable":true,"enum":["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu",null],"description":"The language in which the dashboard content will be displayed","example":"fr"},"format":{"type":"object","nullable":true,"properties":{"orientation":{"type":"string","enum":["portrait","landscape"],"description":"Page orientation","default":"portrait"},"marginTop":{"type":"string","description":"Top margin","example":"20"},"marginRight":{"type":"string","description":"Right margin","example":"20"},"marginBottom":{"type":"string","description":"Bottom margin","example":"20"},"marginLeft":{"type":"string","description":"Left margin","example":"20"},"cards":{"type":"boolean","description":"Show cards in PDF","example":true},"usePageColors":{"type":"boolean","description":"Preserve the page's exact theme background colors instead of forcing white"},"colorScheme":{"type":"string","enum":["light","dark"],"description":"Color scheme: 'light' (default when absent) or 'dark'","example":"dark"},"hiddenSections":{"type":"array","items":{"type":"string"},"description":"Section IDs to hide"},"version":{"type":"string","enum":["working","committed"],"description":"Which version to render","default":"committed"}}},"renderMode":{"type":"string","enum":["shared","perRecipient"],"description":"Render mode"},"runtimeUserId":{"type":"string","nullable":true,"minLength":1,"description":"Runtime user ID","examples":["user_0123456","emb_0120912"]},"recipientSource":{"type":"string","enum":["users","slack"],"description":"Recipient source"},"recipientUserIds":{"type":"array","nullable":true,"items":{"type":"string","minLength":1,"description":"Id of the user","examples":["user_0123456","emb_0120912"]},"description":"Recipient user IDs"},"recipientGroupIds":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Recipient group IDs"},"recipientEmails":{"type":"array","nullable":true,"items":{"type":"string","format":"email"},"description":"Recipient emails"},"slackChannelId":{"type":"string","nullable":true,"description":"Slack channel ID"},"slackMessage":{"type":"string","nullable":true,"description":"Slack message text"},"cron":{"type":"string","description":"Cron expression"},"timezone":{"type":"string","description":"IANA timezone"},"isCustomCron":{"type":"boolean","description":"Whether using custom cron"},"paused":{"type":"boolean","description":"Whether schedule is paused"},"lastRunStartedAt":{"type":"string","nullable":true,"description":"Last run started at"},"startNextRunAt":{"type":"string","description":"Next run scheduled at"},"createdAt":{"type":"string","description":"Created at"},"updatedAt":{"type":"string","description":"Updated at"},"branch":{"type":"string","description":"Git branch"}},"required":["id","organizationId","authorUserId","name","fileName","url","emailSubject","renderMode","recipientSource","cron","timezone","isCustomCron","paused","startNextRunAt","createdAt","updatedAt","branch"]}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"total":{"type":"number"}},"required":["limit","offset","total"]}},"required":["schedules","pagination"]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Delete Report Schedule","tags":["Reports"],"description":"Delete a report schedule (historical report_runs are preserved)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Schedule ID"}},"required":["id"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"204":{"description":"Schedule deleted","content":{"application/json":{"schema":{"type":"null"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{}}}}}}},"/v1/report/schedules/trigger":{"post":{"summary":"Trigger Schedule","tags":["Reports"],"description":"Trigger an existing scheduled report to run immediately (bypasses cron)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Schedule ID"}},"required":["id"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"202":{"description":"Schedule triggered","content":{"application/json":{"schema":{"type":"object","properties":{"scheduleId":{"type":"string"},"status":{"type":"string"}},"required":["scheduleId","status"]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/tables/access":{"get":{"summary":"List Table Access Rule","tags":["Table Access"],"description":"List tables with their access status &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b> ","security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Tables with access status","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the table rule","example":"restrict_my_table"},"table":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","description":"Table name","example":"sales_all_regions"},"applyToAll":{"type":"boolean","default":true,"description":"Apply rule to all users in your org."},"applyTo":{"type":"array","items":{"type":"string","minLength":1,"description":"Id of the user","examples":["user_0123456","emb_0120912"]},"default":[],"description":"Users that should be affected by the rule","example":["user_12345","user_49922"]},"exceptUsers":{"type":"array","items":{"type":"string","minLength":1,"description":"Id of the user","examples":["user_0123456","emb_0120912"]},"default":[],"description":"Users that should be excluded from the rule","example":["user_abc","user_ebc"]}},"required":["name","table","applyToAll","applyTo","exceptUsers"]}},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Save Table Access Rule","tags":["Table Access"],"description":"Save a table access rule  &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"table":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","description":"Table name","example":"sales_all_regions"},"applyToAll":{"type":"boolean","default":true,"description":"Apply rule to all users in your org."},"applyTo":{"type":"array","items":{"type":"string","minLength":1,"description":"Id of the user","example":"user_0123456"},"default":[],"description":"Users that should be affected by the rule, 10 users change at the time use the user endpoint for larger change","example":["user_12345","user_49922"]},"exceptUsers":{"type":"array","items":{"type":"string","minLength":1,"description":"Id of the user","example":"user_0123456"},"default":[],"description":"Users that should be excluded from the rule, 10 users change at the time use the user endpoint for larger change","example":["user_abc","user_ebc"]}},"required":["table"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Tables with access status","content":{"application/json":{"schema":{}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Delete Table Access Rule","tags":["Table Access"],"description":"Delete table access rule &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"table":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","description":"Table name","example":"sales_all_regions"}},"required":["table"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"204":{"description":"Table access rule deleted","content":{"application/json":{"schema":{}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/tables/access/users":{"post":{"summary":"Add User To Table Access Rule","tags":["Table Access"],"description":"Add a user to a table access rule &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"table":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","description":"Table name","example":"sales_all_regions"},"userId":{"type":"string","minLength":1,"description":"Id of the user","example":"user_0123456"}},"required":["table","userId"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"User added to table access rule","content":{"application/json":{"schema":{}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Remove User From Table Access Rule","tags":["Table Access"],"description":"Remove a user from a table access rule &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Team Plan and Above</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"table":{"type":"string","pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$","description":"Table name","example":"sales_all_regions"},"userId":{"type":"string","minLength":1,"description":"Id of the user","example":"user_0123456"}},"required":["table","userId"]}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"User removed from table access rule","content":{"application/json":{"schema":{}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"Not authorized","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/users/invites":{"post":{"summary":"Create Invite","tags":["Workspace Users"],"description":"Invite a user to your organization &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Email address of the person to invite","example":"jane.doe@acme.com"},"role":{"type":"string","enum":["admin","viewer","external-viewer","org-viewer","developer","member"],"description":"Role for the invitee once they join — must be external-viewer when the invite is pre-mapped to a customer","example":"viewer","default":"viewer"},"customerId":{"type":"string","minLength":1,"description":"Pre-map the invitee to this customer (`group_...`): the invitation is sent with role external-viewer and the invitee becomes a member of the customer immediately. Only external-viewer invites can be mapped to a customer.","example":"group_01J2ABC3DEF"},"expiresInDays":{"type":"integer","minimum":1,"maximum":30,"default":7,"description":"How many days the invitation stays valid","example":7}},"required":["email"],"example":{"email":"jane.doe@acme.com","role":"external-viewer","customerId":"group_01J2ABC3DEF","expiresInDays":7}}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"201":{"description":"Invite created","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email address the invite was issued to","example":"jane.doe@acme.com"},"role":{"type":"string","description":"Role the invitee will receive","example":"viewer"},"userId":{"type":"string","nullable":true,"minLength":1,"description":"Id of the invitee's user account, null if not yet available","examples":["user_0123456","emb_0120912"],"example":"user_0123456"},"inviteUrl":{"type":"string","description":"The invite link — the same one delivered in the invitation email. Forward it in your own message if you want the invitee to have it from you as well.","example":"https://studio.example.com/invitation?invitation_token=YNfaBZ6lcuNlFVg4Wmzn8UTp7"}},"required":["email","role","userId","inviteUrl"],"example":{"email":"jane.doe@acme.com","role":"viewer","userId":"user_0123456","inviteUrl":"https://studio.example.com/invitation?invitation_token=YNfaBZ6lcuNlFVg4Wmzn8UTp7"}}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"This feature isn't available with your current permissions, upgrade your role","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"get":{"summary":"List Invites","tags":["Workspace Users"],"description":"List the pending invites of your organization &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"invites":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","description":"Email address the invite was issued to","example":"jane.doe@acme.com"},"userId":{"type":"string","nullable":true,"minLength":1,"description":"Id of the invitee's user account, null if not yet available","examples":["user_0123456","emb_0120912"],"example":"user_0123456"},"inviteUrl":{"type":"string","description":"The invite link — same one delivered in the invitation email","example":"https://studio.example.com/invitation?invitation_token=YNfaBZ6lcuNlFVg4Wmzn8UTp7"},"expiresAt":{"type":"string","description":"When the invite expires","example":"2026-10-14T16:49:07.123Z"},"createdAt":{"type":"string","description":"When the invite was created","example":"2026-10-07T16:49:07.123Z"}},"required":["email","userId","inviteUrl","expiresAt","createdAt"],"example":{"email":"jane.doe@acme.com","userId":"user_0123456","inviteUrl":"https://studio.example.com/invitation?invitation_token=YNfaBZ6lcuNlFVg4Wmzn8UTp7","expiresAt":"2026-10-14T16:49:07.123Z","createdAt":"2026-10-07T16:49:07.123Z"}},"description":"Pending invites of the organization"}},"required":["invites"],"example":{"invites":[{"email":"jane.doe@acme.com","userId":"user_0123456","inviteUrl":"https://studio.example.com/invitation?invitation_token=YNfaBZ6lcuNlFVg4Wmzn8UTp7","expiresAt":"2026-10-14T16:49:07.123Z","createdAt":"2026-10-07T16:49:07.123Z"}]}},{}]}}}},"401":{"description":"This feature isn't available with your current permissions, upgrade your role","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Delete Invite","tags":["Workspace Users"],"description":"Delete a pending invite and its never-activated user &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Email address the invite was issued to","example":"jane.doe@acme.com"}},"required":["email"],"example":{"email":"jane.doe@acme.com"}}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"204":{"description":"Invite deleted","content":{"application/json":{"schema":{}}}},"401":{"description":"This feature isn't available with your current permissions, upgrade your role","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/customers":{"post":{"summary":"Create Customer","tags":["Customers"],"description":"Create a customer (external group) &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Customer name — must be unique within the organization","example":"Café LTD"},"description":{"type":"string","description":"Free-form description","example":"Key account in manufacturing"},"domain":{"type":"string","pattern":"^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$","description":"Customer domain, e.g. for the customer's logo lookup","example":"acme.com"}},"required":["name"],"example":{"name":"Café LTD","description":"Key account in manufacturing","domain":"cafe-ltd.com"}}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"201":{"description":"Customer created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Customer id (`group_...`)","example":"group_01J2ABC3DEF"},"organizationId":{"type":"string","description":"Owning organization id","example":"org_01J2X8Y9ZABCDEF"},"name":{"type":"string","description":"Display name of the customer","example":"Acme Corp"},"slug":{"type":"string","description":"Unique-per-organization slug, auto-generated from the name","example":"acme-corp"},"description":{"type":"string","nullable":true,"description":"Free-form description","example":"Key account in manufacturing"},"domain":{"type":"string","nullable":true,"description":"Customer domain, if set","example":"acme.com"},"memberCount":{"type":"number","description":"Number of members in this customer","example":12},"createdAt":{"type":"string","description":"Creation time","example":"2026-03-01 12:34:56.789+00"},"updatedAt":{"type":"string","description":"Last update time","example":"2026-03-02 09:00:00.123+00"}},"required":["id","organizationId","name","slug","description","domain","memberCount","createdAt","updatedAt"]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"This feature isn't available with your current permissions, upgrade your role","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"get":{"summary":"List Customers","tags":["Customers"],"description":"List the customers of your organization; pass customerId for a single one &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","parameters":[{"schema":{"type":"string","minLength":1,"example":"group_01J2ABC3DEF"},"in":"query","name":"customerId","description":"Get this customer only (`group_...`)"}],"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"anyOf":[{"type":"object","properties":{"customers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Customer id (`group_...`)","example":"group_01J2ABC3DEF"},"organizationId":{"type":"string","description":"Owning organization id","example":"org_01J2X8Y9ZABCDEF"},"name":{"type":"string","description":"Display name of the customer","example":"Acme Corp"},"slug":{"type":"string","description":"Unique-per-organization slug, auto-generated from the name","example":"acme-corp"},"description":{"type":"string","nullable":true,"description":"Free-form description","example":"Key account in manufacturing"},"domain":{"type":"string","nullable":true,"description":"Customer domain, if set","example":"acme.com"},"memberCount":{"type":"number","description":"Number of members in this customer","example":12},"createdAt":{"type":"string","description":"Creation time","example":"2026-03-01 12:34:56.789+00"},"updatedAt":{"type":"string","description":"Last update time","example":"2026-03-02 09:00:00.123+00"}},"required":["id","organizationId","name","slug","description","domain","memberCount","createdAt","updatedAt"]},"description":"Customers of the organization"}},"required":["customers"]},{"type":"object","properties":{"id":{"type":"string","description":"Customer id (`group_...`)","example":"group_01J2ABC3DEF"},"organizationId":{"type":"string","description":"Owning organization id","example":"org_01J2X8Y9ZABCDEF"},"name":{"type":"string","description":"Display name of the customer","example":"Acme Corp"},"slug":{"type":"string","description":"Unique-per-organization slug, auto-generated from the name","example":"acme-corp"},"description":{"type":"string","nullable":true,"description":"Free-form description","example":"Key account in manufacturing"},"domain":{"type":"string","nullable":true,"description":"Customer domain, if set","example":"acme.com"},"memberCount":{"type":"number","description":"Number of members in this customer","example":12},"createdAt":{"type":"string","description":"Creation time","example":"2026-03-01 12:34:56.789+00"},"updatedAt":{"type":"string","description":"Last update time","example":"2026-03-02 09:00:00.123+00"}},"required":["id","organizationId","name","slug","description","domain","memberCount","createdAt","updatedAt"]}]},{}]}}}},"401":{"description":"This feature isn't available with your current permissions, upgrade your role","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"patch":{"summary":"Update Customer","tags":["Customers"],"description":"Update a customer &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","minLength":1,"description":"Id of the customer to update (`group_...`)","example":"group_01J2ABC3DEF"},"name":{"type":"string","minLength":1,"description":"New customer name","example":"Café Inc."},"description":{"type":"string","description":"description attached to customer","example":"Renamed after the merger"},"domain":{"nullable":true,"anyOf":[{"type":"string","pattern":"^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$","description":"Customer domain, e.g. for the customer's logo lookup","example":"acme.com"},{"type":"string","enum":[""]}],"description":"New domain — pass null or an empty string to clear."}},"required":["customerId"],"example":{"customerId":"group_01J2ABC3DEF","name":"Café Inc.","domain":null}}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Customer updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Customer id (`group_...`)","example":"group_01J2ABC3DEF"},"organizationId":{"type":"string","description":"Owning organization id","example":"org_01J2X8Y9ZABCDEF"},"name":{"type":"string","description":"Display name of the customer","example":"Acme Corp"},"slug":{"type":"string","description":"Unique-per-organization slug, auto-generated from the name","example":"acme-corp"},"description":{"type":"string","nullable":true,"description":"Free-form description","example":"Key account in manufacturing"},"domain":{"type":"string","nullable":true,"description":"Customer domain, if set","example":"acme.com"},"memberCount":{"type":"number","description":"Number of members in this customer","example":12},"createdAt":{"type":"string","description":"Creation time","example":"2026-03-01 12:34:56.789+00"},"updatedAt":{"type":"string","description":"Last update time","example":"2026-03-02 09:00:00.123+00"}},"required":["id","organizationId","name","slug","description","domain","memberCount","createdAt","updatedAt"]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"This feature isn't available with your current permissions, upgrade your role","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Delete Customer","tags":["Customers"],"description":"Delete a customer and its members &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","minLength":1,"description":"Id of the customer to delete (`group_...`)","example":"group_01J2ABC3DEF"}},"required":["customerId"],"example":{"customerId":"group_01J2ABC3DEF"}}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"204":{"description":"Customer deleted","content":{"application/json":{"schema":{}}}},"401":{"description":"This feature isn't available with your current permissions, upgrade your role","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}},"/v1/workspaces/customers/members":{"post":{"summary":"Add Customer Members","tags":["Customers"],"description":"Add members to a customer (external group). A user can be in at most one customer per organization. A new email will receive an invitation with role external-viewer (the invitation email is sent automatically) &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","minLength":1,"description":"Customer to add the members to (`group_...`)","example":"group_01J2ABC3DEF"},"emails":{"type":"array","items":{"type":"string","format":"email"},"minItems":1,"maxItems":50,"description":"Email addresses to add (max 50 per batch, duplicates ignored)","example":["jane.doe@acme.com","john.doe@acme.com"]}},"required":["customerId","emails"],"example":{"customerId":"group_01J2ABC3DEF","emails":["jane.doe@acme.com","john.doe@acme.com"]}}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Per-email results","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"object","properties":{"successes":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","description":"Email address of the member","example":"jane.doe@acme.com"},"result":{"type":"string","enum":["invited","added"],"description":"invited: a new invitation was sent with role external-viewer — the provider emails the invitee and the member is added immediately. added: the user was already an external viewer and is now a member of this customer.","example":"invited"},"inviteUrl":{"type":"string","description":"The invitation link — present when result is invited","example":"https://studio.example.com/invitation?invitation_token=YNfaBZ6lcuNlFVg4Wmzn8UTp7"}},"required":["email","result"],"example":{"email":"jane.doe@acme.com","result":"invited","inviteUrl":"https://studio.example.com/invitation?invitation_token=YNfaBZ6lcuNlFVg4Wmzn8UTp7"}},"description":"Emails added or invited"},"failures":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","description":"Email address that was not added","example":"jane.doe@acme.com"},"error":{"type":"string","description":"Why this email was not added","example":"This user is already a member of this customer"}},"required":["email","error"],"example":{"email":"jane.doe@acme.com","error":"This user is already a member of this customer"}},"description":"Emails rejected, with the reason"}},"required":["successes","failures"],"description":"Per-email outcome"}},"required":["results"],"example":{"results":{"successes":[{"email":"jane.doe@acme.com","result":"invited","inviteUrl":"https://studio.example.com/invitation?invitation_token=YNfaBZ6lcuNlFVg4Wmzn8UTp7"},{"email":"existing.viewer@acme.com","result":"added"}],"failures":[{"email":"admin.user@acme.com","error":"This user is already a member with a non-viewer role"}]}}}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"This feature isn't available with your current permissions, upgrade your role","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"get":{"summary":"List Customer Members","tags":["Customers"],"description":"List the members of a customer (external group) &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b>","parameters":[{"schema":{"type":"string","minLength":1,"example":"group_01J2ABC3DEF"},"in":"query","name":"customerId","required":true,"description":"Customer whose members to list (`group_...`)"}],"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"200":{"description":"Data returning...","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"User id of the member","example":"user_01J2X8Y9ZABCDEF"},"email":{"type":"string","description":"Email address of the member","example":"jane.doe@acme.com"},"name":{"type":"string","description":"Display name — the email until the invitee sets one","example":"Jane Doe"},"status":{"type":"string","enum":["active","pending"],"description":"pending until the invitee first signs in","example":"active"}},"required":["userId","email","name","status"],"example":{"userId":"user_01J2X8Y9ZABCDEF","email":"jane.doe@acme.com","name":"Jane Doe","status":"active"}},"description":"Members of the customer"}},"required":["members"],"example":{"members":[{"userId":"user_01J2X8Y9ZABCDEF","email":"jane.doe@acme.com","name":"Jane Doe","status":"active"}]}},{}]}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"This feature isn't available with your current permissions, upgrade your role","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Delete Customer Member","tags":["Customers"],"description":"Remove a member from a customer (external group) &nbsp;<b><a target='_blank' href='https://evidence.dev/pricing'>Enterprise Only</a></b> ","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","minLength":1,"description":"Customer to remove the member from (`group_...`)","example":"group_01J2ABC3DEF"},"email":{"type":"string","format":"email","description":"Email address of the member to remove","example":"jane.doe@acme.com"}},"required":["customerId","email"],"example":{"customerId":"group_01J2ABC3DEF","email":"jane.doe@acme.com"}}}}},"security":[{"secretKey":[]},{"cookieAuth":[]}],"responses":{"204":{"description":"Member removed","content":{"application/json":{"schema":{}}}},"400":{"description":"Request is invalid","content":{"application/json":{"schema":{}}}},"401":{"description":"This feature isn't available with your current permissions, upgrade your role","content":{"application/json":{"schema":{}}}},"403":{"description":"Feature unavailable: Your current plan doesn't include this functionality. Please upgrade to continue","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{}}}},"500":{"description":"Oops something went wrong on our end. Please try again later.","content":{"application/json":{"schema":{}}}}}}}},"servers":[{"url":"https://management.evidence.studio"}],"tags":[{"name":"Profile","description":"Identity and session of the current user"},{"name":"Access Token","description":"Auth Proxy Token (APT) management"},{"name":"Introspec","description":"Token introspection"},{"name":"Workspaces","description":"Workspace management"},{"name":"Workspace Users","description":"List and search the users of the workspace's organization"},{"name":"Deploy","description":"Deploy source tables to the managed warehouse"},{"name":"Sources","description":"Deployed source registry and status"},{"name":"Schemas","description":"Connection testing and schema discovery"},{"name":"Models","description":"Model management"},{"name":"RLS","description":"Row-level security rules"},{"name":"RLS Users","description":"User-scoped row-level security rules"},{"name":"Table Access","description":"Table-level access rules"},{"name":"Tokens","description":"API tokens"},{"name":"Reports","description":"Report schedules and runs"},{"name":"Embedded","description":"Embedded sessions"},{"name":"Analytics","description":"Usage analytics"},{"name":"Variables","description":"Environment variables"},{"name":"Fivetran","description":"Fivetran integration"},{"name":"Region","description":"Region lookup"},{"name":"Service","description":"Service information"}]}