openapi: 3.2.0 info: title: Automile Resource Owner Company API version: v1 tags: - name: ResourceOwnerCompany paths: /v1/resourceowner/companies: get: tags: - ResourceOwnerCompany summary: Get a list of all companies that user is associated with description: Only companies that the user is associated with will be returned by this operation. operationId: GetResourceOwnerCompanies responses: '200': description: The companies are returned content: text/plain: schema: type: array items: $ref: '#/components/schemas/CompanyModel' application/json: schema: type: array items: $ref: '#/components/schemas/CompanyModel' text/json: schema: type: array items: $ref: '#/components/schemas/CompanyModel' '500': description: Internal server error security: - oauth2: [] post: tags: - ResourceOwnerCompany summary: Creates a new company and associates it with the user operationId: CreateResourceOwnerCompany responses: '200': description: A link in the header is returned to the newly created company '500': description: Internal server error security: - oauth2: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/CompanyCreateModel' text/json: schema: $ref: '#/components/schemas/CompanyCreateModel' application/*+json: schema: $ref: '#/components/schemas/CompanyCreateModel' description: The company model /v1/resourceowner/companies/{companyId}: get: tags: - ResourceOwnerCompany summary: Get a company by id description: The user only has access to contacts that it is associated with through the company operationId: GetByCompanyId parameters: - in: path name: companyId description: The Id of the company required: true schema: type: integer format: int32 responses: '200': description: The company details are returned content: text/plain: schema: $ref: '#/components/schemas/CompanyDetailModel' application/json: schema: $ref: '#/components/schemas/CompanyDetailModel' text/json: schema: $ref: '#/components/schemas/CompanyDetailModel' '500': description: Internal server error security: - oauth2: [] put: tags: - ResourceOwnerCompany summary: Updates the given company id description: This will update the company contact with the new model. operationId: EditResourceOwnerCompany parameters: - in: path name: companyId description: The company id required: true schema: type: integer format: int32 responses: '200': description: The company was saved '500': description: Internal server error security: - oauth2: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/CompanyEditModel' text/json: schema: $ref: '#/components/schemas/CompanyEditModel' application/*+json: schema: $ref: '#/components/schemas/CompanyEditModel' description: The company model delete: tags: - ResourceOwnerCompany summary: Removes the given company description: This will delete the given company contact. operationId: DeleteResourceOwnerCompany parameters: - in: path name: companyId description: The company id required: true schema: type: integer format: int32 responses: '200': description: The company has been deleted '500': description: Internal server error security: - oauth2: [] components: schemas: CompanyCreateModel: required: - CreateRelationshipToContactId - RegisteredCompanyName type: object properties: RegisteredCompanyName: maxLength: 255 minLength: 0 type: string RegistrationNumber: type: string Description: type: string CreateRelationshipToContactId: format: int32 type: integer additionalProperties: false CompanyModel: type: object properties: CompanyId: format: int32 type: integer RegisteredCompanyName: type: string RegistrationNumber: type: string additionalProperties: false CompanyEditModel: required: - RegisteredCompanyName type: object properties: RegisteredCompanyName: maxLength: 255 minLength: 0 type: string RegistrationNumber: type: string Description: type: string additionalProperties: false CompanyDetailModel: type: object properties: CompanyId: format: int32 type: integer RegisteredCompanyName: type: string RegistrationNumber: type: string Description: type: string LastModified: format: date-time type: string Created: format: date-time type: string additionalProperties: false securitySchemes: oauth2: type: oauth2 flows: implicit: scopes: read: Read access to protected resources write: Write access to protected resources authorizationUrl: https://api.automile.com/login/ description: OAuth2 Implicit Grant x-provenance: method: harvested publisher: Automileab source: https://api.automile.com/swagger/v1/swagger.json note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json); stamped by stamp-openapi-provenance.py (roadmap#793)