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

# Create AuthSession - Start

> Start creating an AuthSession.



## OpenAPI

````yaml post /{workspaceId}/projects/{projectName}/auth-sessions/create
openapi: 3.1.0
info:
  title: Intuned Client
  version: 0.0.2
  description: Programmatically trigger automations, manage Jobs, and handle AuthSessions.
  termsOfService: https://intuned.ai/terms
  contact:
    email: founders@intunedhq.com
servers:
  - url: https://app.intuned.io/api/v1/workspace
    description: Base URL for Intuned API.
security:
  - api_key: []
tags:
  - name: projects.jobs
    description: Project Jobs API
  - name: projects.jobs.runs
    description: Project JobRuns API
  - name: projects.runs
    description: Run APIs
  - name: projects.authSessions
    description: Manage AuthSessions
  - name: projects.authSessions.validate
    description: Validate AuthSession
  - name: projects.authSessions.create
    description: Create AuthSession
  - name: projects.authSessions.update
    description: Update AuthSession
externalDocs:
  description: Find out more about Intuned
  url: https://intunedhq.com/docs/
paths:
  /{workspaceId}/projects/{projectName}/auth-sessions/create:
    post:
      tags:
        - projects.authSessions.create
      summary: Create AuthSession - Start
      description: Start creating an AuthSession.
      operationId: CreateOrUpdateAuthSessionStart
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          description: >-
            Your workspace ID. [How to find
            it](/main/03-how-to/manage/manage-workspace#how-to-get-your-workspace-id)?
          example: 123e4567-e89b-12d3-a456-426614174000
          in: path
          name: workspaceId
          x-speakeasy-globals-hidden: true
        - schema:
            type: string
          required: true
          description: The name you assigned when creating the Project.
          example: my-project
          in: path
          name: projectName
      requestBody:
        description: Create AuthSession input schema
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  minLength: 3
                  pattern: ^[a-zA-Z0-9-(),_]+$
                  description: The unique identifier for the authentication session
                  example: auth-session-123
                parameters:
                  type: object
                  additionalProperties: true
                  description: The parameters to be passed to the API.
                  example:
                    param1: value1
                    param2: 42
                    param3: true
                proxy:
                  type:
                    - string
                    - 'null'
                  format: uri
                  description: Proxy configuration for the job
                  example: http://username:password@proxy.example.com:8080
                createAttempts:
                  type: integer
                  default: 3
                  description: >-
                    Number of attempts to create a new AuthSession if the
                    current one is invalid or expired.
                  example: 3
                checkAttempts:
                  type: integer
                  default: 3
                  description: >-
                    Number of attempts to check the validity of the AuthSession
                    before recreating it.
                  example: 3
                saveTrace:
                  type: boolean
                  default: true
              required:
                - parameters
            example:
              parameters:
                username: john.doe
                password: password
              proxy: http://proxy.example.com:8080
              createAttempts: 3
              checkAttempts: 3
              saveTrace: true
              requestTimeout: 60000
      responses:
        '201':
          description: Create AuthSession operation started
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - started
                  operationId:
                    type: string
                required:
                  - status
                  - operationId
              examples:
                started:
                  summary: Operation started
                  value:
                    status: started
                    operationId: aabbccddeeffggh
      x-codeSamples:
        - lang: typescript
          label: CreateOrUpdateAuthSessionStart
          source: |
            import { IntunedClient } from "@intuned/client";

            const client = new IntunedClient({
              workspaceId: "123e4567-e89b-12d3-a456-426614174000",
              apiKey: process.env["INTUNED_API_KEY"] ?? "",
            });

            async function run() {
              const result = await client.projects.authSessions.create.start(
                "my-project",
                {
                  parameters: {
                    "param1": "value1",
                    "param2": 42,
                    "param3": true
                  },
                },
            );

              console.log(result);
            }

            run();
        - lang: python
          label: Python (SDK)
          source: |-
            from intuned_client import IntunedClient
            from intuned_client import models
            import os


            with IntunedClient(
                workspace_id="123e4567-e89b-12d3-a456-426614174000",
                api_key=os.getenv("INTUNED_API_KEY", ""),
            ) as client:

                res = client.projects.auth_sessions.create.start(
                    project_name="my-project",
                    body=models.AuthSessionsCreateStartRequestBody(
                            parameters={
                                "param1": "value1",
                                "param2": 42,
                                "param3": True,
                            },
                            id="auth-session-123",
                            proxy="http://username:password@proxy.example.com:8080",
                            createAttempts=3,
                        ),
                )

                print(res)
components:
  securitySchemes:
    api_key:
      type: apiKey
      description: >-
        API Key used to authenticate your requests. [How to create
        one](/main/03-how-to/manage/manage-api-keys).
      in: header
      name: x-api-key

````