SAS Viya REST API

The SAS Viya REST API spans 50+ endpoint groups covering Cloud Analytic Services (CAS), Compute, Data Management (Data Sources, Data Tables, Data Quality), Model Management, Decisions, Business Rules, Reports, Visual Analytics, Identities, Authorization, Files, Folders, Jobs, and Logon (OAuth). Together they let developers automate SAS Viya analytic workloads, publish models, embed reports, and govern AI lifecycles.

Documentation

Specifications

SDKs

Schemas & Data

Other Resources

OpenAPI Specification

sas-viya-rest-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: SAS Viya REST API
  description: >-
    Representative slice of the SAS Viya REST API surface across the platform's
    primary capability domains: jobs, reports, models, decisions, identities,
    files, folders, and OAuth via SAS Logon. The full catalog lists 50+
    services at https://developer.sas.com/rest-apis.
  version: '2024.10'
  contact:
    name: SAS Developer Portal
    url: https://developer.sas.com/
servers:
  - url: https://{viya-host}
    description: A SAS Viya deployment
    variables:
      viya-host:
        default: viya.example.com
        description: The tenant host for the SAS Viya deployment
security:
  - oauth2: []
paths:
  /SASLogon/oauth/token:
    post:
      summary: Obtain OAuth Access Token
      operationId: getAccessToken
      tags: [Logon]
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                grant_type: { type: string }
                username: { type: string }
                password: { type: string }
      responses:
        '200':
          description: OAuth token response
  /identities/users:
    get:
      summary: List Users
      operationId: listUsers
      tags: [Identities]
      responses:
        '200':
          description: A collection of users
          content:
            application/vnd.sas.collection+json:
              schema:
                $ref: '#/components/schemas/UserCollection'
  /identities/users/{id}:
    get:
      summary: Get User
      operationId: getUser
      tags: [Identities]
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      responses:
        '200':
          description: A user
          content:
            application/vnd.sas.identity+json:
              schema:
                $ref: '#/components/schemas/User'
  /folders/folders:
    get:
      summary: List Folders
      operationId: listFolders
      tags: [Folders]
      responses:
        '200':
          description: A collection of folders
  /files/files:
    post:
      summary: Upload File
      operationId: uploadFile
      tags: [Files]
      responses:
        '201':
          description: File created
  /jobExecution/jobs:
    get:
      summary: List Jobs
      operationId: listJobs
      tags: [Jobs]
      responses:
        '200':
          description: A collection of jobs
          content:
            application/vnd.sas.collection+json:
              schema:
                $ref: '#/components/schemas/JobCollection'
    post:
      summary: Create Job
      operationId: createJob
      tags: [Jobs]
      requestBody:
        required: true
        content:
          application/vnd.sas.job.execution.job.request+json:
            schema:
              $ref: '#/components/schemas/Job'
      responses:
        '201':
          description: Job created
  /jobExecution/jobs/{id}:
    get:
      summary: Get Job
      operationId: getJob
      tags: [Jobs]
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      responses:
        '200':
          description: A job
          content:
            application/vnd.sas.job.execution.job+json:
              schema:
                $ref: '#/components/schemas/Job'
  /reports/reports:
    get:
      summary: List Reports
      operationId: listReports
      tags: [Reports]
      responses:
        '200':
          description: A collection of reports
          content:
            application/vnd.sas.collection+json:
              schema:
                $ref: '#/components/schemas/ReportCollection'
  /reports/reports/{id}:
    get:
      summary: Get Report
      operationId: getReport
      tags: [Reports]
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      responses:
        '200':
          description: A report
          content:
            application/vnd.sas.report+json:
              schema:
                $ref: '#/components/schemas/Report'
  /modelRepository/models:
    get:
      summary: List Models
      operationId: listModels
      tags: [Models]
      responses:
        '200':
          description: A collection of models
  /modelManagement/projects:
    get:
      summary: List Model Projects
      operationId: listModelProjects
      tags: [Models]
      responses:
        '200':
          description: A collection of model management projects
  /decisions/flows:
    get:
      summary: List Decision Flows
      operationId: listDecisionFlows
      tags: [Decisions]
      responses:
        '200':
          description: A collection of decision flows
          content:
            application/vnd.sas.collection+json:
              schema:
                $ref: '#/components/schemas/DecisionCollection'
  /decisions/flows/{id}:
    get:
      summary: Get Decision Flow
      operationId: getDecisionFlow
      tags: [Decisions]
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      responses:
        '200':
          description: A decision flow
          content:
            application/vnd.sas.decision+json:
              schema:
                $ref: '#/components/schemas/Decision'
  /businessRules/ruleSets:
    get:
      summary: List Rule Sets
      operationId: listRuleSets
      tags: [BusinessRules]
      responses:
        '200':
          description: A collection of rule sets
  /casManagement/servers:
    get:
      summary: List CAS Servers
      operationId: listCasServers
      tags: [CAS]
      responses:
        '200':
          description: A collection of CAS servers
components:
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        password:
          tokenUrl: /SASLogon/oauth/token
          scopes:
            openid: OpenID Connect scope
  schemas:
    User:
      type: object
      properties:
        id: { type: string }
        name: { type: string }
        type: { type: string, enum: [user, group] }
        providerId: { type: string }
    UserCollection:
      type: object
      properties:
        items:
          type: array
          items: { $ref: '#/components/schemas/User' }
        count: { type: integer }
    Job:
      type: object
      properties:
        id: { type: string }
        name: { type: string }
        state: { type: string, enum: [pending, running, completed, failed, canceled] }
        jobDefinitionUri: { type: string }
        createdBy: { type: string }
        creationTimeStamp: { type: string, format: date-time }
        endTimeStamp: { type: string, format: date-time }
    JobCollection:
      type: object
      properties:
        items:
          type: array
          items: { $ref: '#/components/schemas/Job' }
        count: { type: integer }
    Report:
      type: object
      properties:
        id: { type: string }
        name: { type: string }
        description: { type: string }
        createdBy: { type: string }
        modifiedTimeStamp: { type: string, format: date-time }
    ReportCollection:
      type: object
      properties:
        items:
          type: array
          items: { $ref: '#/components/schemas/Report' }
        count: { type: integer }
    Decision:
      type: object
      properties:
        id: { type: string }
        name: { type: string }
        majorRevision: { type: integer }
        minorRevision: { type: integer }
        createdBy: { type: string }
        creationTimeStamp: { type: string, format: date-time }
    DecisionCollection:
      type: object
      properties:
        items:
          type: array
          items: { $ref: '#/components/schemas/Decision' }
        count: { type: integer }