{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"Data Workbench","type":"markdown"},"seo":{"title":"Setting Your API Key and Endpoints","description":"Learn how to securely set your Treasure AI API key and endpoint using CLI, with step-by-step instructions for accessing and configuring sensitive credentials.","siteUrl":"https://docs.treasure.ai","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"setting-your-api-key-and-endpoints","__idx":0},"children":["Setting Your API Key and Endpoints"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Secrets are objects that contain sensitive data. Secrets allow you to access Treasure Data and pass sensitive information into the Console without compromising security. To do this, you’ll need to set your API Key and endpoint. You can access your API Key from ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://console.treasuredata.com/"},"children":["Treasure Console"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Your ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/my-settings/getting-your-api-keys"},"children":["personal API Key"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/endpoints"},"children":["endpoint"]}," corresponding to your site access"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"obtain-your-api-key-and-endpoints","__idx":2},"children":["Obtain your API Key and Endpoints"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open the Console"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["My Settings > API Keys"]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200130-185736.ff12ed24ff0d8e54a80e777fa24c629a5707656a46c7787cd18b2b59fd5643f0.0bddf20e.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":3},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Copy your API Key"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200130-232001.a96cc85a6fdf70eb0a9e3ce6514809071db49b29a64b935e28c253ff445c51ea.0bddf20e.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the appropriate ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/endpoints"},"children":["endpoint"]},".",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"For example: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api-workflow.us01.treasuredata.com"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"set-your-api-key-and-endpoint-using-the-cli","__idx":3},"children":["Set your API Key and Endpoint using the CLI"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open the terminal."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open your workflow directory."]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"cd /users/<yourname>/mydirectory\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":3},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Pass Secrets into the CLI using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--project"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--set"]}," commands to designate the project and set the API Key and endpoint."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td wf secrets --project my_project --set apikey=1234565/abcdefghijklmnopqrstu --endpoint=https://api-workflow.treasuredata.com\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The terminal displays the following results:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200130-190854.7a28d747fffc8ddf0d8a4a0f82e88c41b707ef0859edda6da3ad1b2f2c751d6b.0bddf20e.png","alt":""},"children":[]}]}]},"headings":[{"value":"Setting Your API Key and Endpoints","id":"setting-your-api-key-and-endpoints","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Obtain your API Key and Endpoints","id":"obtain-your-api-key-and-endpoints","depth":2},{"value":"Set your API Key and Endpoint using the CLI","id":"set-your-api-key-and-endpoint-using-the-cli","depth":2}],"frontmatter":{"seo":{"title":"Setting Your API Key and Endpoints","description":"Learn how to securely set your Treasure AI API key and endpoint using CLI, with step-by-step instructions for accessing and configuring sensitive credentials."}},"lastModified":"2026-06-17T07:22:53.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/data-workbench/workflows/setting-your-api-key-and-endpoints","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}