Skip to content
English
  • There are no suggestions because the search field is empty.

πŸ”ŒREST API Access via Swagger

THIS GUIDE SHOWS YOU HOW TO ACCESS THE CASEBASE REST API VIA SWAGGER – WITHOUT ANY PROGRAMMING SKILLS.

🚨 REQUIREMENTS

  • You have an active Casebase account (via email & password or Microsoft SSO).

  • You are logged into Casebase in your browser.

  • You know the URL of your instance, e.g.:
    https://demo.casebase.ai

πŸ“„ Overview

A) πŸ”— Open Swagger Documentation
B) πŸ” Retrieve Bearer Token
C) πŸ” Authorize in Swagger
D) πŸ“‚ Select an API
E) πŸš€ Execute an API Request
F) βœ… Result
G) 🎯 How this guide helps you work with the REST API

 

A) πŸ”— Open Swagger Documentation

Open the following URL in your browser to access the interactive API documentation:

https://account_name.casebase.ai/api/v1/swagger-ui/index.html

 

Replace account_name with the base URL of your instance.


B) πŸ” Retrieve Bearer Token

To authenticate in Swagger, you need a Bearer token. Here’s how to get it:

  1. Log in to your Casebase account
    β†’ e.g. https://demo.casebase.ai

  2. Open your browser’s Developer Tools
    β†’ Right click β†’ β€œInspect” or press F12

  3. Go to the Network tab
    β†’ Reload the page if needed to see the requests

  4. Click on a request that includes an Authorization header or search (control+f) for the term "Bearer" 


  5. Copy the token from the header
    β†’ Example: Authorization: Bearer eyJhbGciOi...
    β†’ Only copy the token itself – without the word β€œBearer”

 

 



C) πŸ” Authorize in Swagger

  1. Open the Swagger UI:
    https://demo.casebase.ai/api/v1/swagger-ui/index.html

  2. Click Authorize in the top right

  3. Paste the token in the format:

    Bearer eyJhbGciOi...
  4. Click Authorize, then Close


D) πŸ“‚ Select an API

You’re now authenticated and can try any available API.

For example, search for:
WorkspaceUseCaseController β†’ GET /api/v1/workspaces/{workspaceId}/use-cases

Click the entry to view more details.


E) πŸš€ Execute an API Request (β€œTry it out”)

  1. Click Try it out

  2. Insert your Workspace ID
    β†’ Go back to your Casebase app
    β†’ Open Developer Tools β†’ Network tab β†’ search for workspaces
    β†’ Copy a workspace ID (e.g. c2c3f1c3-0e7b-4e7b-9c21...)

  3. Insert the Use Case ID
    β†’ Similarly, search the Network tab for id or use-case
    β†’ Use it as a path parameter

  4. Select your login method (Provider):

    • AD = SSO via Microsoft

    • PW = Email & Password

  5. Click Execute

πŸ’‘ Token Validity & Error Handling

If Swagger returns an error like 401 Unauthorized, your token may have expired.
Simply repeat step B) to get a new token and re-authorize in Swagger.

 


F) βœ… Result

You now receive the API response directly in the Swagger interface, including:

  • The HTTP status code (e.g. 200 OK)

  • The response data (e.g. a JSON list of use cases)

  • The headers and payloads used in the request


G) 🎯 How this guide helps you work with the REST API

1. Understand what the API can do

In Swagger you can see:

  • All available endpoints (e.g. /use-cases, /workspaces)

  • The HTTP method (GET, POST, PUT, DELETE)

  • What data to send (parameters, request body)

  • What kind of response you will get

➑ You know exactly how to interact with the API.


2. Authenticate and use tokens correctly

Most APIs are protected – without a token, you get no access.
You learn:

  • How to get a valid Bearer token

  • How to use it correctly in Swagger

➑ You can send authorized API requests – just like a real client.


3. Test the API without writing code

You can test everything in Swagger before coding:

  • Fetch a use case

  • Create a workspace

  • Update or delete data

➑ You get instant feedback without writing a single line of code.


4. Prepare for real-world use (e.g. Postman or your own code)

Once your request works:

  • You can recreate it in Postman

  • Or integrate it directly into your code (e.g. using fetch(), axios, or curl)

➑ You can easily apply what you learned from Swagger in your actual application.