> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drssed.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Drssed API quickstart: your first wardrobe call

> Make your first Drssed API calls: create a guest session, upload a clothing image, save the item to a wardrobe, and build your first outfit.

This page walks you through the four core actions you will take in almost every Drssed integration: getting an access token, processing a clothing image, saving the clothing item, and creating an outfit. You do not need an account — a guest session is enough to complete all four steps.

<Note>
  Access tokens expire after 1 hour. Store the `refresh_token` returned in step 1 and call `POST /auth/refresh` before the token expires to get a new one without losing your session. See [Authentication](/authentication#refreshing-tokens) for details.
</Note>

<Steps>
  <Step title="Create a guest session">
    Call `POST /auth/guest` to receive a JWT access token instantly. No credentials required. The response includes an `access_token` valid for 1 hour, its expiry in seconds, and a `refresh_token` you can use to extend the session.

    <CodeGroup>
      ```bash curl theme={null}
      curl -X POST https://api.drssed.com/auth/guest
      ```
    </CodeGroup>

    ```json Response theme={null}
    {
      "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "expires_in": 3600,
      "refresh_token": "dGhpcyBpcyBhIHNhbXBsZSByZWZyZXNo"
    }
    ```

    Use the `access_token` value as the Bearer token in all subsequent requests.
  </Step>

  <Step title="Upload a clothing image">
    Send a clothing photo to `POST /images/preview` as a `multipart/form-data` request with a `file` field. Drssed removes the background and uses AI to detect the item's category, dominant color, suitable seasons, and style tags. The response includes an `image_id` you will use in the next step.

    <CodeGroup>
      ```bash curl theme={null}
      curl -X POST https://api.drssed.com/images/preview \
        -H "Authorization: Bearer {access_token}" \
        -F "file=@jacket.jpg"
      ```
    </CodeGroup>

    ```json Response theme={null}
    {
      "image_url": "https://cdn.drssed.com/images/processed/abc123.png",
      "image_id": "img_abc123",
      "image_color": "Navy",
      "image_category": "JACKET",
      "image_seasons": ["Autumn", "Winter"],
      "image_tags": ["Casual", "Vintage"]
    }
    ```

    The `image_category` will be one of `JACKET`, `TOP`, `BOTTOM`, or `FOOTWEAR`. The `image_seasons` and `image_tags` values are AI-generated suggestions — you can override them when saving the item.
  </Step>

  <Step title="Save the clothing item">
    Use the `image_id` from the previous step to persist the clothing item to your wardrobe by calling `POST /users/me/clothing`. Supply the metadata you want to store — you can use the AI-suggested values or override them.

    <CodeGroup>
      ```bash curl theme={null}
      curl -X POST https://api.drssed.com/users/me/clothing \
        -H "Authorization: Bearer {access_token}" \
        -H "Content-Type: application/json" \
        -d '{
          "name": "Navy Denim Jacket",
          "category": "JACKET",
          "color": "Navy",
          "seasons": ["Autumn", "Winter"],
          "tags": ["Casual", "Vintage"],
          "image_id": "img_abc123"
        }'
      ```
    </CodeGroup>

    ```json Response theme={null}
    {
      "clothing": {
        "clothing_id": "clth_xyz789",
        "user_id": "usr_def456",
        "name": "Navy Denim Jacket",
        "category": "JACKET",
        "color": "Navy",
        "seasons": ["Autumn", "Winter"],
        "tags": ["Casual", "Vintage"],
        "image_id": "img_abc123",
        "is_public": false,
        "created_at": "2026-04-30T12:00:00+00:00"
      }
    }
    ```

    The `clothing_id` in the response is what you will reference when building outfits.
  </Step>

  <Step title="Create an outfit">
    Call `POST /users/me/outfits` to combine one or more clothing items into a named outfit. Use the `scene` field to store canvas placement data for each item — position, scale, rotation, and z-index — which lets clients render the outfit visually.

    <CodeGroup>
      ```bash curl theme={null}
      curl -X POST https://api.drssed.com/users/me/outfits \
        -H "Authorization: Bearer {access_token}" \
        -H "Content-Type: application/json" \
        -d '{
          "name": "Weekend look",
          "seasons": ["Autumn"],
          "tags": ["Casual"],
          "is_public": false,
          "is_favorite": false,
          "scene": [
            {
              "clothing_id": "clth_xyz789",
              "x": 0.5,
              "y": 0.3,
              "z": 1,
              "scale": 1.0,
              "rotation": 0.0
            }
          ]
        }'
      ```
    </CodeGroup>

    ```json Response theme={null}
    {
      "outfit": {
        "outfit_id": "outf_qrs321",
        "user_id": "usr_def456",
        "name": "Weekend look",
        "seasons": ["Autumn"],
        "tags": ["Casual"],
        "is_public": false,
        "is_favorite": false,
        "scene": [
          {
            "clothing_id": "clth_xyz789",
            "x": 0.5,
            "y": 0.3,
            "z": 1,
            "scale": 1.0,
            "rotation": 0.0
          }
        ],
        "created_at": "2026-04-30T12:01:00+00:00",
        "updated_at": "2026-04-30T12:01:00+00:00"
      }
    }
    ```
  </Step>
</Steps>

## Next steps

* Read the [Authentication](/authentication) page to learn how to refresh tokens, log in with a full account, and upgrade guest sessions.
* Explore the [API Reference](/api/auth/guest) for the full parameter and response schema for every endpoint.
