PageSourceSearch

https://www.canva.dev/_next/static/chunks/pages/docs/admin/api-reference/users/get-user-ee55f612966dd11e.js

js canva.dev collected 2026-09-24 17:13:31 UTC 12,088 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3c3454d7-243d-4e7b-8025-7622108c2924",e._sentryDebugIdIdentifier="sentry-dbid-3c3454d7-243d-4e7b-8025-7622108c2924")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[82888],{5902:(e,n,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/docs/admin/api-reference/users/get-user",function(){return r(62710)}])},62710:(e,n,r)=>{"use strict";r.r(n),r.d(n,{default:()=>p,meta:()=>u});var s=r(54245),t=r(44736),i=r(65321),d=r(39084),a=r(55650);function o(e){let n={a:"a",code:"code",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,d.R)(),...e.components},{ApiMethod:r,Heading:s,PillAccordion:t,Prop:o,Tab:l,Tabs:h}=n;return r||c("ApiMethod",!0),s||c("Heading",!0),t||c("PillAccordion",!0),o||c("Prop",!0),o.Extras||c("Prop.Extras",!0),o.List||c("Prop.List",!0),l||c("Tab",!0),h||c("Tabs",!0),(0,i.jsxs)(i.Fragment,{children:["\n","\n",(0,i.jsx)(n.p,{children:"Gets a user."}),"\n",(0,i.jsx)(s,{depth:2,id:"http-method-and-url-path",children:"HTTP method and URL path"}),"\n",(0,i.jsx)(r,{method:"GET",url:"https://api.canva.com/admin/v1/users/{userId}"}),"\n",(0,i.jsx)(s,{depth:2,id:"authentication-and-authorization",children:"Authentication and authorization"}),"\n",(0,i.jsx)(n.p,{children:"This endpoint requires a valid access token that was generated using client credentials."}),"\n",(0,i.jsx)(s,{depth:3,id:"scopes",children:"Scopes"}),"\n",(0,i.jsxs)(n.p,{children:["The access token must have all the following ",(0,i.jsx)(n.a,{href:"/docs/admin/appendix/scopes/",children:"scopes"})," (permissions):"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"admin:user:read"})}),"\n"]}),"\n",(0,i.jsx)(s,{depth:2,id:"header-parameters",children:"Header parameters"}),"\n",(0,i.jsx)(o.List,{children:(0,i.jsxs)(o,{name:"Authorization",type:"string",required:!0,children:[(0,i.jsxs)(n.p,{children:["Provides credentials to authenticate the request, in the form of a ",(0,i.jsx)(n.code,{children:"Bearer"})," token."]}),(0,i.jsxs)(n.p,{children:["For example: ",(0,i.jsx)(n.code,{children:"Authorization: Bearer {token}"})]})]})}),"\n",(0,i.jsx)(s,{depth:2,id:"path-parameters",children:"Path parameters"}),"\n",(0,i.jsx)(o.List,{children:(0,i.jsx)(o,{name:"userId",type:"string",required:!0,children:(0,i.jsx)(n.p,{children:"The user ID."})})}),"\n",(0,i.jsx)(s,{depth:2,id:"example-request",children:"Example request"}),"\n",(0,i.jsxs)(n.p,{children:["Examples for using the ",(0,i.jsx)(n.code,{children:"/v1/users/{userId}"})," endpoint:"]}),"\n",(0,i.jsxs)(h,{storageKey:"example.language",disableContentTransition:!0,children:[(0,i.jsx)(l,{name:"cURL",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"curl --request GET 'https://api.canva.com/admin/v1/users/{userId}' \\\n--header 'Authorization: Bearer {token}'\n"})})}),(0,i.jsx)(l,{name:"Node.js",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:'const fetch = require("node-fetch");\n\nfetch("https://api.canva.com/admin/v1/users/{userId}", {\n  method: "GET",\n  headers: {\n    "Authorization": "Bearer {token}",\n  },\n})\n  .then(async (response) => {\n    const data = await response.json();\n    console.log(data);\n  })\n  .catch(err => console.error(err));\n'})})}),(0,i.jsx)(l,{name:"Java",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-java",children:'import java.io.IOException;\nimport java.net.URI;\nimport java.net.http.*;\n\npublic class ApiExample {\n    public static void main(String[] args) throws IOException, InterruptedException {\n        HttpRequest request = HttpRequest.newBuilder()\n            .uri(URI.create("https://api.canva.com/admin/v1/users/{userId}"))\n            .header("Authorization", "Bearer {token}")\n            .method("GET", HttpRequest.BodyPublishers.noBody())\n            .build();\n\n        HttpResponse<String> response = HttpClient.newHttpClient().send(\n            request,\n            HttpResponse.BodyH
1andlers.ofString()\n        );\n        System.out.println(response.body());\n    }\n}\n'})})}),(0,i.jsx)(l,{name:"Python",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-py",children:'import requests\n\nheaders = {\n    "Authorization": "Bearer {token}"\n}\n\nresponse = requests.get("https://api.canva.com/admin/v1/users/{userId}",\n    headers=headers\n)\nprint(response.json())\n'})})}),(0,i.jsx)(l,{name:"C#",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-csharp",children:'using System.Net.Http;\n\nvar client = new HttpClient();\nvar request = new HttpRequestMessage\n{\n  Method = HttpMethod.Get,\n  RequestUri = new Uri("https://api.canva.com/admin/v1/users/{userId}"),\n  Headers =\n  {\n    { "Authorization", "Bearer {token}" },\n  },\n};\n\nusing (var response = await client.SendAsync(request))\n{\n  response.EnsureSuccessStatusCode();\n  var body = await response.Content.ReadAsStringAsync();\n  Console.WriteLine(body);\n};\n'})})}),(0,i.jsx)(l,{name:"Go",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-go",children:'package main\n\nimport (\n	"fmt"\n	"io"\n	"net/http"\n)\n\nfunc main() {\n	url := "https://api.canva.com/admin/v1/users/{userId}"\n	req, _ := http.NewRequest("GET", url, nil)\n	req.Header.Add("Authorization", "Bearer {token}")\n\n	res, _ := http.DefaultClient.Do(req)\n	defer res.Body.Close()\n	body, _ := io.ReadAll(res.Body)\n	fmt.Println(string(body))\n}\n'})})}),(0,i.jsx)(l,{name:"PHP",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-php",children:'$curl = curl_init();\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => "https://api.canva.com/admin/v1/users/{userId}",\n  CURLOPT_CUSTOMREQUEST => "GET",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_HTTPHEADER => array(\n    \'Authorization: Bearer {token}\',\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\ncurl_close($curl);\n\nif (empty($err)) {\n  echo $response;\n} else {\n  echo "Error: " . $err;\n}\n'})})}),(0,i.jsx)(l,{name:"Ruby",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ruby",children:"require 'net/http'\nrequire 'uri'\n\nurl = URI('https://api.canva.com/admin/v1/users/{userId}')\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest['Authorization'] = 'Bearer {token}'\n\nresponse = http.request(request)\nputs response.read_body\n"})})})]}),"\n",(0,i.jsxs)(a.Tl,{children:[(0,i.jsx)(s,{depth:2,end:(0,i.jsx)(a.$E,{}),children:"Success response"}),(0,i.jsxs)(n.p,{children:["If successful, the endpoint returns a ",(0,i.jsx)(n.code,{children:"200"})," response with a JSON body with the following parameters:"]}),(0,i.jsx)(o.List,{children:(0,i.jsxs)(o,{name:"user",type:"User",required:!0,mode:"output",children:[(0,i.jsx)(n.p,{children:"A user."}),(0,i.jsx)(t,{title:(0,i.jsxs)(i.Fragment,{children:["Properties of ",(0,i.jsx)(n.strong,{children:"user"})]}),defaultExpanded:!0,children:(0,i.jsxs)(o.List,{children:[(0,i.jsx)(o,{name:"id",type:"string",required:!0,mode:"output",children:(0,i.jsx)(n.p,{children:"The user ID."})}),(0,i.jsx)(o,{name:"display_name",type:"string",mode:"output",children:(0,i.jsx)(n.p,{children:"The display name of the user."})}),(0,i.jsx)(o,{name:"email",type:"string",mode:"output",children:(0,i.jsx)(n.p,{children:"The email address of the user."})}),(0,i.jsx)(o,{name:"first_name",type:"string",mode:"output",children:(0,i.jsx)(n.p,{children:"The first name of the user."})}),(0,i.jsx)(o,{name:"last_name",type:"string",mode:"output",children:(0,i.jsx)(n.p,{children:"The last name of the user."})}),(0,i.jsx)(o,{name:"last_active_at",type:"integer",mode:"output",children:(0,i.jsx)(n.p,{children:"When the user was last active, as a Unix timestamp (in seconds since the Unix Epoch)."})}),(0,i.jsx)(o,{name:"locale",type:"string",mode:"output",children:(0,i.jsx)(n.p,{children:"The locale of the user, as an IETF BCP 47 language tag."})}),(0,i.jsxs)(o,{name:"role",type:"string",mode:"output",children:[(0,i.jsx)(n.p,{children:"The role of the user in the organization."}),(0,i.jsxs)(o.Extras,{children:[(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Available values:"})}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"admin"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"brand_designer"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"member"})}),"\n"]})]})]}),(0,i.jsxs)(o,{name:"saml_account",type:"SamlAccount",mode:"output",children:[(0,i.jsx)(n.p,{children:"The SAML account details used to link the user to the organization's identity provider for SSO."}),(0,i.jsx)(t,{title:(0,i.jsxs)(i.Fragment,{children:["Properties of ",(0,i.jsx)(n.strong,{children:"saml_account"})]}),children:(0,i.jsxs)(o.List,{children:[(0,i.jsxs)(o,{name:"idp_issuer",type:"string",required:!0,mode:"output",children:[(0,i.jsx)(n.p,{children:"The issuer URL of the SAML identity provider. Must resolve to an identity provider owned by the caller's organization."}),(0,i.jsx)(o.Extras,{children:(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Minimum length:"})," ",(0,i.jsx)(n.code,{children:"1"})]})})]}),(0,i.jsxs)(o,{name:"name_id",type:"string",required:!0,mode:"output",children:[(0,i.jsx)(n.p,{children:"The SAML NameID that identifies the user to the identity provider. This value is case sensitive, and shouldn't change."}),(0,i.jsx)(o.Extras,{children:(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Minimum length:"})," ",(0,i.jsx)(n.code,{children:"1"})]})})]})]})})]})]})})]})}
1),(0,i.jsx)(s,{depth:2,id:"example-response",children:"Example response"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n  "user": {\n    "id": "UAAAAAAAAA1",\n    "display_name": "Joe Smith",\n    "email": "[email protected]",\n    "first_name": "Joe",\n    "last_name": "Smith",\n    "last_active_at": 1750300000,\n    "locale": "en",\n    "role": "admin"\n  }\n}\n'})})]}),"\n",(0,i.jsx)(s,{depth:2,id:"error-responses",children:"Error responses"}),"\n",(0,i.jsx)(s,{depth:3,id:"404-not-found",children:"404 Not Found"}),"\n",(0,i.jsxs)(o.List,{children:[(0,i.jsx)(o,{name:"code",type:"string",required:!0,mode:"output",children:(0,i.jsxs)(n.p,{children:["A short string indicating what failed. This field can be used to handle errors programmatically. For a complete list of error codes, see ",(0,i.jsx)(n.a,{href:"/docs/admin/error-responses/",children:"Error responses"}),"."]})}),(0,i.jsx)(o,{name:"message",type:"string",required:!0,mode:"output",children:(0,i.jsx)(n.p,{children:"A human-readable description of what went wrong."})})]}),"\n",(0,i.jsx)(s,{depth:4,id:"example-error-response",children:"Example error response"}),"\n",(0,i.jsx)(s,{depth:5,id:"the-user-was-not-found",children:"The user was not found"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n  "code": "user_not_found",\n  "message": "User {userId} not found"\n}\n'})})]})}function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}function c(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function h(e){return(0,i.jsx)(l,{})}function p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}
1let u={title:"Get user"};p.getLayout=e=>(0,i.jsx)(s.r,{children:(0,i.jsx)(t.K,{...u,children:e})})}},e=>{e.O(0,[33096,39058,38460,87726,11886,75319,84624,77411,88586,18716,54047,62156,86664,36492,74056,93010,90636,46593,38792],()=>e(e.s=5902)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.