For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
SupportDashboard
Getting StartedAPI ReferenceRoadmapBlog
Getting StartedAPI ReferenceRoadmapBlog
    • Resources
    • Authentication
    • Pagination
    • Rate limiting
  • API Keys
    • GETList api keys
    • GETGet api key
    • POSTCreate api key
    • PUTUpdate api key
    • DELDelete api key
  • Environments
    • POSTCreate environment
    • PUTUpdate environment
    • DELDelete environment
  • Plans
    • The Plan object
    • GETList plans
    • GETGet plan
    • POSTCreate plan
    • PUTUpdate plan
    • DELDelete plan
  • Companies
    • The Company object
    • GETList companies
    • POSTUpsert company
    • GETLookup company
    • DELDelete company
    • POSTDelete company by keys
    • GETList company memberships
    • POSTGet or create company membership
    • DELDelete company membership
    • POSTUpsert company trait
  • Users
    • The User object
    • GETList users
    • GETLookup user
    • POSTUpsert user
    • DELDelete user
    • POSTDelete user by keys
    • POSTUpsert user trait
  • Events
    • The Event object
    • GETList events
    • POSTCreate event
    • POSTCreate event batch
    • GETGet event
  • Features
    • The Feature object
    • GETList features
    • GETGet feature
    • POSTCreate feature
    • PUTUpdate feature
    • DELDelete feature
  • Flags
    • The Flag object
    • GETList flags
    • GETGet flag
    • POSTCreate flag
    • PUTUpdate flag
    • DELDelete flag
    • PUTUpdate flag rules
    • POSTCheck flag
    • POSTCheck flags
  • Entitlements
    • GETList company overrides
    • GETGet company override
    • POSTCreate company override
    • PUTUpdate company override
    • DELDelete company override
    • GETList plan entitlements
    • GETGet plan entitlement
    • POSTCreate plan entitlement
    • PUTUpdate plan entitlement
    • DELDelete plan entitlement
  • Feature Usage
    • GETList feature usage
  • Billing Credits
    • GETList credits
    • POSTCreate credit
    • GETGet credit
    • PUTUpdate credit
    • DELDelete credit
    • GETList credit bundles
    • POSTCreate credit bundle
    • GETGet credit bundle
    • PUTUpdate credit bundle
    • DELDelete credit bundle
    • POSTGrant credits to company
    • GETList company credit grants
    • GETList credit grants
    • PUTZero out credit grant
    • GETList plan credit grants
    • POSTCreate plan credit grant
    • DELDelete plan credit grant
    • GETGet credit ledger
  • Account Members
    • GETList account members
    • GETGet account member
LogoLogo
SupportDashboard
Users

Upsert user

POST
https://api.schematichq.com/users
POST
/users
1import { SchematicClient } from "@schematichq/schematic-typescript-node";
2
3async function main() {
4 const client = new SchematicClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.companies.upsertUser({});
8}
9main();
1{
2 "data": {
3 "company_memberships": [
4 {
5 "company_id": "comp_123456789",
6 "created_at": "2023-11-20T08:45:00Z",
7 "id": "membership_456789123",
8 "updated_at": "2024-04-01T09:15:00Z",
9 "user_id": "user_987654321",
10 "company": {
11 "created_at": "2023-11-20T08:45:00Z",
12 "environment_id": "env_987654321",
13 "id": "comp_123456789",
14 "name": "Acme Corporation",
15 "updated_at": "2024-04-01T09:15:00Z",
16 "last_seen_at": "2024-04-10T12:00:00Z",
17 "logo_url": "https://example.com/logos/acme_corp.png"
18 }
19 }
20 ],
21 "created_at": "2023-11-20T08:45:00Z",
22 "entity_traits": [
23 {
24 "created_at": "2023-11-20T08:45:00Z",
25 "definition_id": "trait_def_001",
26 "environment_id": "env_987654321",
27 "id": "trait_123456789",
28 "updated_at": "2024-04-01T09:15:00Z",
29 "value": "true",
30 "definition": {
31 "created_at": "2023-11-15T07:30:00Z",
32 "display_name": "Is Admin",
33 "entity_type": "user",
34 "hierarchy": [
35 "role",
36 "access"
37 ],
38 "id": "trait_def_001",
39 "trait_type": "boolean",
40 "updated_at": "2024-04-01T09:15:00Z"
41 }
42 }
43 ],
44 "environment_id": "env_987654321",
45 "id": "user_987654321",
46 "keys": [
47 {
48 "created_at": "2023-11-20T08:45:00Z",
49 "definition_id": "key_def_001",
50 "entity_id": "user_987654321",
51 "entity_type": "user",
52 "environment_id": "env_987654321",
53 "id": "key_123456789",
54 "key": "email",
55 "updated_at": "2024-04-01T09:15:00Z",
56 "value": "jane.doe@example.com",
57 "definition": {
58 "created_at": "2023-11-15T07:30:00Z",
59 "entity_type": "user",
60 "id": "key_def_001",
61 "key": "email",
62 "updated_at": "2024-04-01T09:15:00Z"
63 }
64 }
65 ],
66 "name": "Jane Doe",
67 "updated_at": "2024-04-01T09:15:00Z",
68 "last_seen_at": "2024-04-10T12:00:00Z",
69 "traits": {}
70 },
71 "params": {}
72}
Was this page helpful?
Previous

Delete user

Next
Built with

Authentication

X-Schematic-Api-Keystring
API Key authentication via header

Request

This endpoint expects an object.
keysmap from strings to stringsRequired

See Key Management for more information

companieslist of maps from strings to strings or nullOptional

Optionally specify companies using array of key/value pairs

companymap from strings to strings or nullOptional
Add user to this company. Takes priority over companies. For exhaustive list of companies, use companies
company_idstring or nullOptional

Add user to this company. Takes priority over company_ids. For exhaustive list of companies, use company_ids

company_idslist of strings or nullOptional
Optionally specify companies using Schematic company ID
idstring or nullOptional
If you know the Schematic ID, you can use that here instead of keys
last_seen_atdatetime or nullOptional
namestring or nullOptional<=256 characters
traitsobjectOptional
A map of trait names to trait values
update_onlyboolean or nullOptional

Response

OK
dataobject
paramsobject
Input parameters

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error