{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/voice-2.0/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["partial","admonition"]},"product":"Voice v2 (preview)","type":"markdown"},"seo":{"title":"Basic authentication | Voice API | Sinch","siteUrl":"https://developers.sinch.com","llmstxt":{"title":"Sinch Developer Documentation","description":"LLMs.txt containing a map of all the documentation files for Sinch.","sections":[{"title":"Numbers API","description":"The Numbers API enables you to search for, view, and activate numbers. It's considered a precursor to other APIs in the Sinch product family. The numbers API can be used in tandem with any of our APIs that perform messaging or calling.","includeFiles":["docs/numbers/**/*.md","docs/numbers/**/*.yaml"],"excludeFiles":["docs/numbers/index.md"]},{"title":"Conversation API","description":"Send and receive messages globally on many popular channels with ease and confidence when using Sinch's Conversation API. Conversation API is the preferred API for sending mobile messages on SMS and other social channels with Sinch. It is a simple API with unified error messages, consistent request payloads, and common webhook payloads that are channel-agnostic.","includeFiles":["docs/conversation/**/*.md","docs/conversation/**/*.yaml"],"excludeFiles":["docs/conversation/index.md"]},{"title":"Voice API","description":"The Voice API works as a big telephony switch. The Voice API handles incoming phone calls (also known as incoming call “legs”), sets up outgoing phone calls (or outgoing call “legs”), and bridges the two. The incoming call leg may come in over a data connection (from a smartphone or web application using the Sinch SDKs) or through a local phone number (from the PSTN network). Similarly, the outgoing call leg can be over data (to another smartphone or web application using the Sinch SDKs) or the PSTN network.","includeFiles":["docs/voice/**/*.md","docs/voice/**/*.yaml"],"excludeFiles":["docs/voice/index.md"]},{"title":"Voice API v2","description":"The Voice API works as a big telephony switch. The Voice API handles incoming phone calls (also known as incoming call “legs”), sets up outgoing phone calls (or outgoing call “legs”), and bridges the two. The incoming call leg may come in over a data connection (from a smartphone or web application using the Sinch SDKs) or through a local phone number (from the PSTN network). Similarly, the outgoing call leg can be over data (to another smartphone or web application using the Sinch SDKs) or the PSTN network.","includeFiles":["docs/voice-2.0/**/*.md","docs/voice-2.0/**/*.yaml"],"excludeFiles":["docs/voice-2.0/index.md"]},{"title":"Verification API","description":"The Verification API is a platform for phone number verification. It consists of the API and different software development kits (the Sinch SDKs) that you integrate with your smartphone or web application and cloud based back-end services. Together they enable SMS, Flashcall, Phone Call and Data verification in your application.","includeFiles":["docs/verification/**/*.md","docs/verification/**/*.yaml"],"excludeFiles":["docs/verification/index.md"]},{"title":"Provisioning API","description":"Provisioning API allows you to programmatically set up your senders, accounts and templates on your favorite messaging platforms on the Conversation API. For now, you can create your first WhatsApp channel through Meta's Embedded sign up, you can configure your first SMS App and configure your webhooks. As development continues, we will be adding the most commonly used channels.","includeFiles":["docs/provisioning-api/**/*.md","docs/provisioning-api/**/*.json"],"excludeFiles":["docs/provisioning-api/index.md"]},{"title":"Elastic SIP Trunking API","description":"With Elastic SIP Trunking you can create and manage your SIP trunks and phone numbers programmatically.","includeFiles":["docs/est/**/*.md","docs/est/**/*.yaml"],"excludeFiles":["docs/est/index.md"]},{"title":"Fax API","description":"Send and receive HIPAA compliant faxes on our modern fax platform using our developer-friendly API.","includeFiles":["docs/fax/**/*.md","docs/fax/**/*.yaml"],"excludeFiles":["docs/fax/index.md"]},{"title":"In-app Voice and Video SDK","description":"The In-app Voice and Video SDK enables you to add voice and video calling capabilities directly into your mobile or web application using the Sinch SDKs.","includeFiles":["docs/in-app-calling/**/*.md"],"excludeFiles":["docs/in-app-calling/index.md"]},{"title":"Number Lookup API","description":"The Number Lookup API is designed to provide in-depth information about phone numbers, helping enterprises enhance their communication strategies and prevent fraud. By identifying the type of phone line (for example, mobile, landline, VoIP) and the associated carrier, the API allows businesses to optimize routing, reduce unnecessary costs, and improve customer engagement.","includeFiles":["docs/number-lookup-api-v2/**/*.md","docs/number-lookup-api-v2/**/*.yaml"],"excludeFiles":["docs/number-lookup-api-v2/index.md"]},{"title":"Functions","description":"Serverless compute for voice and messaging. Deploy your code and Sinch routes live calls and messages to it — no infrastructure to run.","includeFiles":["docs/functions/functions/**/*.md","docs/functions/concepts/**/*.md","docs/functions/reference/**/*.md"],"excludeFiles":["docs/functions/functions/index.md"]},{"title":"CLI","description":"One command line for every Sinch API and the full Functions lifecycle — scaffold, run locally, deploy, and manage.","includeFiles":["docs/functions/cli/**/*.md"],"excludeFiles":["docs/functions/cli/index.md"]}]},"description":"How to perform basic authentication for the Sinch Voice API v2 API."},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"basic-http-authentication","__idx":0},"children":["Basic HTTP authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"http://en.wikipedia.org/wiki/Basic_access_authentication"},"children":["HTTP Basic authentication "]},"works on all Sinch REST APIs. Basic auth is often the preferred option for testing because it is simple and easy to use."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Important!"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Basic authentication is intended for test purposes only, and should only be used for experimenting with APIs and building prototypes. API calls using basic authentication are heavily rate limited, and these limits may change at any time without warning. Production systems should use OAuth access tokens instead."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Basic authentication is sent in the authorization header with each call."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No matter the programming language, there are three main components for successful basic authentication in a request:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The designation of authorization type, which is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["basic"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["username"]},", which in Sinch's case is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YOUR_Key_ID"]},", corresponding to your project"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["password"]},", which is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YOUR_Key_Secret"]},", again, corresponding to the project"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can view and manage your API credentials ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://dashboard.sinch.com/settings/access-keys"},"children":["here"]},"."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Need help?"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Check out ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://community.sinch.com/t5/Virtual-Numbers/What-is-a-project-and-where-do-I-find-the-key-and-secret/ta-p/8794"},"children":["this article"]}," for a walk-through on finding your key and secret."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To use basic auth in an API call, do the following:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["First, create a new access key ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://dashboard.sinch.com/settings/access-keys"},"children":["in the Sinch Build Dashboard"]}," by clicking ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create Access Key"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Copy your ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["project ID"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["key ID"]},", and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["key secret"]},"."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Important!"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Keep your key secret somewhere safe as it is ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["only viewable upon initial project creation"]},". The project ID and key ID are always readily available in the Sinch Build Dashboard. If you misplace your key secret, simply generate a new key!"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use your key ID as the username (sometimes called the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_id"]},") and your key secret as the password (can be referred to as the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_secret"]},") in every call made to a Sinch API."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"examples","__idx":1},"children":["Examples"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This example will return all services for your project using the Voice API. Replace all relevant parameters with your credential (including the curly braces ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{}"]},"). Note that you'll also need your project ID, which is ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://dashboard.sinch.com/settings/access-keys"},"children":["found in the Sinch Build Dashboard"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"curl -i -X GET \\\n'https://voice.api.sinch.com/v2/projects/{YOUR_project_id}/services' \\\n  -H 'Content-Type: application/json' \\\n  -u {YOUR_Key_ID}:{YOUR_Key_Secret}\n","lang":"shell"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["That's it!"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Note:"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you're ready for production, be sure to ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/voice-2.0/api-reference/authentication/oauth"},"children":["check out our OAuth2.0 authentication"]}," process for greater security."]}]}]},"headings":[{"value":"Basic HTTP authentication","id":"basic-http-authentication","depth":1},{"value":"Examples","id":"examples","depth":2}],"frontmatter":{"seo":{"title":"Basic authentication | Voice API | Sinch","description":"How to perform basic authentication for the Sinch Voice API v2 API."}},"lastModified":"2026-08-31T13:48:15.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/voice-2.0/api-reference/authentication/basic","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}