1"use strict";(globalThis.webpackChunk_atlas_docs_zen=globalThis.webpackChunk_atlas_docs_zen||[]).push([[3240],{4010(e,t,s){s.r(t),s.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>i,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"sdks/typescript/endpoints/update-key-details","title":"updateKeyDetails","description":"Update Details","source":"@site/docs/sdks/typescript/endpoints/update-key-details.mdx","sourceDirName":"sdks/typescript/endpoints","slug":"/sdks/typescript/endpoints/update-key-details","permalink":"/docs/sdks/typescript/endpoints/update-key-details","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"id":"update-key-details","title":"updateKeyDetails"},"sidebar":"sdks","previous":{"title":"keyDetails","permalink":"/docs/sdks/typescript/endpoints/key-details"},"next":{"title":"keyUsage","permalink":"/docs/sdks/typescript/endpoints/key-usage"}}');var r=s(5723),d=s(4056);const i={id:"update-key-details",title:"updateKeyDetails"},a="updateKeyDetails",l={},c=[{value:"Endpoint",id:"endpoint",level:2},{value:"Import",id:"import",level:2},{value:"Path Parameters",id:"path-parameters",level:2},{value:"Query Parameters",id:"query-parameters",level:2},{value:"Request Body",id:"request-body",level:2},{value:"Response Type",id:"response-type",level:2},{value:"Errors",id:"errors",level:2},{value:"Example",id:"example",level:2}];function o(e){const t={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,d.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"updatekeydetails",children:(0,r.jsx)(t.code,{children:"updateKeyDetails"})})}),"\n",(0,r.jsx)(t.p,{children:"Update Details"}),"\n",(0,r.jsxs)(t.p,{children:["Updates a key's settings and returns its private details. Only the fields you send change. A key on an unlimited plan ignores changes to ",(0,r.jsx)(t.code,{children:"datasets"}),", ",(0,r.jsx)(t.code,{children:"daily_limit"})," and ",(0,r.jsx)(t.code,{children:"monthly_limit"}),"."]}),"\n",(0,r.jsx)(t.h2,{id:"endpoint",children:"Endpoint"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.code,{children:"PUT /keys/{key}/details"})}),"\n",(0,r.jsxs)(t.p,{children:["See the ",(0,r.jsx)(t.a,{href:"/docs/api/update-key-details",children:"API reference"})," for this endpoint."]}),"\n",(0,r.jsxs)(t.p,{children:["This operation needs a Management Key. Set it as ",(0,r.jsx)(t.code,{children:"userToken"})," on the client, which sends it in the ",(0,r.jsx)(t.code,{children:"Authorization"})," header. See ",(0,r.jsx)(t.a,{href:"/docs/sdks/typescript/setup",children:"setup"}),"."]}),"\n",(0,r.jsx)(t.h2,{id:"import",children:"Import"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",children:'import { updateKeyDetails } from "@addresszen/sdk";\n'})}),"\n",(0,r.jsx)(t.h2,{id:"path-parameters",children:"Path Parameters"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Name"}),(0,r.jsx)(t.th,{children:"Type"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsx)(t.tbody,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"key"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:"string"})}),(0,r.jsx)(t.td,{children:"yes"}),(0,r.jsxs)(t.td,{children:[(0,r.jsx)(t.strong,{children:"API Key"})," The API Key to retrieve. Begins ",(0,r.jsx)(t.code,{children:"ak_"}),"."]})]})})]}),"\n",(0,r.jsx)(t.h2,{id:"query-parameters",children:"Query Parameters"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.em,{children:"None."})}),"\n",(0,r.jsx)(t.h2,{id:"request-body",children:"Request Body"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",children:"ApiKeyDetailsEditable\n"})}),"\n",(0,r.jsx)(t.h2,{id:"response-type",children:"Response Type"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",children:'import type { UpdateKeyDetailsResponse } from "@addresszen/sdk";\n'})}),"\n",(0,r.jsx)(t.h2,{id:"errors",children:"Errors"}),"\n",(0,r.jsxs)(t.p,{children:["HTTP errors throw an ",(0,r.jsx)(t.code,{children:"ApiError"})," with the HTTP ",(0,r.jsx)(t.code,{children:"status"})," and the API error ",(0,r.jsx)(t.code,{children:"code"})," and ",(0,r.jsx)(t.code,{children:"message"}),". Network failures and aborts reject with the runtime's native error. Pass ",(0,r.jsx)(t.code,{children:"throwOnError: false"})," to get ",(0,r.jsx)(t.code,{children:"{ data, error }"})," instead. See ",(0,r.jsx)(t.a,{href:"/docs/sdks/typescript/errors",children:"error handling"}),"."]}),"\n",(0,r.jsx)(t.h2,{id:"example",children:"Example"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="update-key-details.ts"',children:'import { createZenClient, updateKeyDetails } from "@addresszen/sdk";\n\nexport const example = async () => {\n const client = createZenClient({\n apiKey: "ak_test",\n userToken: "uk_example",\n });\n const { data } = await updateKeyDetails({\n client,\n path: { key: "ak_test" },\n body: { daily_limit: { limit: 1000 } },\n });\n return data;\n};\n'})})]})}function p(e={}){const{wrapper:t}={...(0,d.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(o,{...e})}):o(e)}},4056(e,t,s){s.d(t,{R:()=>i,x:()=>a});var n=s(2155);const r={},d=n.createContext(r);function i(e){const t=n.useContext(d);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),n.createElement(d.Provider,{value:t},e.children)}}}]);
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.