# Introduction

### Reference

The REST API is build of a list of endpoints to manipulate and read data from PIM.  To see the full reference of all API endpoints, [click here](/api-reference/endpoints.md).

### Authorization <a href="#authorization" id="authorization"></a>

In order to use the API, you need to set up an API key. This is done in the Settings -> API configuration in StructPIM.

Once you have generated an API key, you need to provide it in the Authorization header of every request you make to the API in order to get access. If you have not got access to the endpoint you are requesting with the provided API key, you will get a 403, Forbidden response code

### Swagger support <a href="#swagger-support" id="swagger-support"></a>

The Struct PIM REST Api supports Swagger for documentation and is accessible through \[UrlToSaasAPI]/swagger.

### C# API client <a href="#c-api-client" id="c-api-client"></a>

We provide a C# API client, available in the official Nuget feed (**Struct.App.Api.Client**). We recommend using this, if you are working in C#, as it gets you going a lot faster compared to wrapping the API yourself. The client is compiled for .NET standard 2.0, making it available to most .NET projects.

### Demo project <a href="#demo-project" id="demo-project"></a>

If you are implementing your integration using .NET and C#, we recommend having a look at our Demo project, which shows examples on how to get data through the Api and how to insert data using the Api.

{% file src="/files/6R6XsTw6DMeVv7usjkBM" %}
Download demo project here
{% endfile %}

### Autogenerate models <a href="#autogenerate-models" id="autogenerate-models"></a>

If you are using C#, a T4Template can be used to autogenerate C# classes matching the model setup of your products, variants, categories and global lists in your PIM setup, making integration through the API even easier. Download the T4Template here.

{% file src="/files/JClUcuqsNn1yIYDNoQkP" %}
T4 template
{% endfile %}

### Performance <a href="#performance" id="performance"></a>

The API is build for updating and reading large amounts of data in short time. All areas has extended support for batching data together to make the updating as smooth as possible.

We do not recommend using the API as a direct source for presentation if performance is the main focus. \
You should always transfer the data needed for presentation, from the API, to a fast read and search friendly  cache layer.

This ensures optimal performance at all times.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.struct.com/api-reference/introduction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
