---
updatedAt: 2025-09-23T21:25:29.000Z
agentTools:
  projectIndex: https://developer.2hire.io/llms.txt
---

# Register a vehicle

Register a vehicle in the system in order to interact with it

<br />

# OpenAPI definition

```json
{
  "openapi": "3.0.2",
  "info": {
    "version": "1.0.0",
    "title": "2hireAsAdapter API - Test",
    "description": "2hireAsAdapter API lets you manage and control one vehicle and a thousand vehicle alike.",
    "contact": {
      "name": "2hire",
      "email": "info@2hire.io",
      "url": "https://2hire.io"
    }
  },
  "servers": [
    {
      "url": "https://test.adapter.2hire.io"
    }
  ],
  "tags": [
    {
      "name": "Vehicle Registration",
      "description": "Register a vehicle in the system"
    }
  ],
  "paths": {
    "/api/v1/vehicle/register": {
      "put": {
        "security": [
          {
            "Bearer": []
          }
        ],
        "tags": [
          "Vehicle Registration"
        ],
        "summary": "Register a vehicle",
        "operationId": "PutRegisterVehicle",
        "description": "Register a vehicle in the system in order to interact with it",
        "parameters": [
          {
            "name": "x-user",
            "in": "header",
            "description": "User identifier",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-application",
            "in": "header",
            "description": "Application identifier",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/2HireBoardRegistrationSchema"
                  }
                ],
                "discriminator": {
                  "propertyName": "connectivityProvider",
                  "mapping": {
                    "2HIRE_BOARD": "#/components/schemas/2HireBoardRegistrationSchema"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SuccessRegistrationResponse"
          },
          "400": {
            "$ref": "#/components/responses/BadRequestRegisterError"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationError"
          },
          "403": {
            "$ref": "#/components/responses/AuthorizationError"
          },
          "409": {
            "$ref": "#/components/responses/RegistrationConflictError"
          },
          "500": {
            "$ref": "#/components/responses/InternalErrorIdempotentRegisterResponse"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailableError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "responses": {
      "SuccessRegistrationResponse": {
        "description": "Success Registration Response",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SuccessRegistrationResponse"
            },
            "examples": {
              "success response": {
                "summary": "Success Response",
                "value": {
                  "vehicleId": "54234990-c9e7-4057-8172-0c3a6f06a0e3"
                }
              }
            }
          }
        }
      },
      "ServiceUnavailableError": {
        "description": "Service Unavailable Response",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ServiceUnavailableError"
            },
            "examples": {
              "Register Disabled": {
                "value": {
                  "code": "SERVICE_UNAVAILABLE",
                  "details": {
                    "cause": "SERVICE_UNAVAILABLE"
                  },
                  "errorId": "21127d29-1587-4cc7-92c6-d74b98497e56"
                }
              },
              "Idempotent Register Disabled": {
                "value": {
                  "code": "SERVICE_UNAVAILABLE",
                  "details": {
                    "cause": "SERVICE_UNAVAILABLE"
                  },
                  "errorId": "21127d29-1587-4cc7-92c6-d74b98497e56"
                }
              },
              "Deregister Disabled": {
                "value": {
                  "code": "SERVICE_UNAVAILABLE",
                  "details": {
                    "cause": "SERVICE_UNAVAILABLE"
                  },
                  "errorId": "21127d29-1587-4cc7-92c6-d74b98497e56"
                }
              }
            }
          }
        }
      },
      "AuthenticationError": {
        "description": "Authentication Error Response",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AuthenticationError"
            },
            "examples": {
              "Token expired": {
                "summary": "Token Expired",
                "value": {
                  "code": "AUTHENTICATION_ERROR",
                  "details": {
                    "cause": "TOKEN_EXPIRED"
                  },
                  "errorId": "21127d29-1587-4cc7-92c6-d74b98497e56"
                }
              }
            }
          }
        }
      },
      "RegistrationConflictError": {
        "description": "Conflict Error response",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ConflictErrorPayloadConflict"
            },
            "examples": {
              "Vehicle Registration Conflict": {
                "summary": "Vehicle Registration Conflict",
                "value": {
                  "code": "CONFLICT_ERROR",
                  "details": {
                    "cause": "PAYLOAD_CONFLICT"
                  },
                  "errorId": "21127d29-1587-4cc7-92c6-d74b98497e56"
                }
              }
            }
          }
        }
      },
      "BadRequestRegisterError": {
        "description": "Bad Request and Ineligibility Error Response",
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/BadRequestError"
                }
              ]
            },
            "examples": {
              "Bad Format Error": {
                "value": {
                  "code": "BAD_REQUEST_ERROR",
                  "details": {
                    "cause": "BAD_FORMAT"
                  },
                  "errorId": "21127d29-1587-4cc7-92c6-d74b98497e56"
                }
              },
              "Vehicle Not Eligible": {
                "value": {
                  "code": "BAD_REQUEST_ERROR",
                  "details": {
                    "cause": "BAD_REQUEST"
                  },
                  "errorId": "21127d29-1587-4cc7-92c6-d74b98497e56"
                }
              }
            }
          }
        }
      },
      "AuthorizationError": {
        "description": "Authorization Error Response",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AuthorizationError"
            },
            "examples": {
              "Authorization Error": {
                "value": {
                  "code": "AUTHORIZATION_ERROR",
                  "details": {
                    "cause": "INSUFFICIENT_PERMISSIONS"
                  },
                  "errorId": "21127d29-1587-4cc7-92c6-d74b98497e56"
                }
              }
            }
          }
        }
      },
      "InternalErrorIdempotentRegisterResponse": {
        "description": "Internal Error Response Schema",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/InternalError"
            },
            "examples": {
              "Internal Error": {
                "value": {
                  "code": "INTERNAL_ERROR",
                  "details": {
                    "cause": "INTERNAL_ERROR"
                  },
                  "errorId": "21127d29-1587-4cc7-92c6-d74b98497e56"
                }
              },
              "Qr Code Not Found": {
                "value": {
                  "code": "INTERNAL_ERROR",
                  "details": {
                    "cause": "QR_CODE_NOT_FOUND"
                  },
                  "errorId": "21127d29-1587-4cc7-92c6-d74b98497e56"
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "SuccessRegistrationResponse": {
        "type": "object",
        "properties": {
          "vehicleId": {
            "type": "string",
            "description": "Identifier of the vehicle generated by 2hire"
          }
        }
      },
      "InternalErrorCause": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "Specific cause of the error",
            "enum": [
              "INTERNAL_ERROR"
            ]
          }
        }
      },
      "QRCodeNotFoundCause": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "Specific cause of the error",
            "enum": [
              "QR_CODE_NOT_FOUND"
            ]
          }
        }
      },
      "InternalError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Code of the error",
            "enum": [
              "INTERNAL_ERROR"
            ]
          },
          "details": {
            "type": "object",
            "oneOf": [
              {
                "$ref": "#/components/schemas/InternalErrorCause"
              },
              {
                "$ref": "#/components/schemas/QRCodeNotFoundCause"
              }
            ]
          },
          "errorId": {
            "type": "string",
            "description": "uuid generated in order to track logs"
          }
        }
      },
      "ServiceUnavailableErrorCause": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "Specific cause of the error",
            "enum": [
              "SERVICE_UNAVAILABLE"
            ]
          }
        }
      },
      "ServiceUnavailableError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Code of the error",
            "enum": [
              "SERVICE_UNAVAILABLE"
            ]
          },
          "details": {
            "$ref": "#/components/schemas/ServiceUnavailableErrorCause"
          },
          "errorId": {
            "type": "string",
            "description": "uuid generated in order to track logs"
          }
        }
      },
      "BadRequestCause": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "Specific cause of the error",
            "enum": [
              "BAD_REQUEST"
            ]
          }
        }
      },
      "InvalidUUIDCause": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "Specific cause of the error",
            "enum": [
              "INVALID_UUID"
            ]
          }
        }
      },
      "InvalidSignalNameCause": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "Specific cause of the error",
            "enum": [
              "INVALID_SIGNAL_NAME"
            ]
          }
        }
      },
      "BadFormatCause": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "Specific cause of the error",
            "enum": [
              "BAD_FORMAT"
            ]
          }
        }
      },
      "BadRequestError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Code of the error",
            "enum": [
              "BAD_REQUEST_ERROR"
            ]
          },
          "details": {
            "type": "object",
            "oneOf": [
              {
                "$ref": "#/components/schemas/BadRequestCause"
              },
              {
                "$ref": "#/components/schemas/InvalidUUIDCause"
              },
              {
                "$ref": "#/components/schemas/InvalidSignalNameCause"
              },
              {
                "$ref": "#/components/schemas/BadFormatCause"
              }
            ]
          },
          "errorId": {
            "type": "string",
            "description": "uuid generated in order to track logs"
          }
        }
      },
      "AuthorizationError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Code of the error",
            "enum": [
              "AUTHORIZATION_ERROR"
            ]
          },
          "cause": {
            "type": "string",
            "description": "Specific cause of the error",
            "enum": [
              "INSUFFICIENT_PERMISSIONS",
              "UNKNOWN"
            ]
          },
          "errorId": {
            "type": "string",
            "description": "uuid generated in order to track logs"
          }
        }
      },
      "AuthenticationError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Code of the error",
            "enum": [
              "AUTHENTICATION_ERROR"
            ]
          },
          "details": {
            "type": "object",
            "properties": {
              "cause": {
                "type": "string",
                "description": "Specific cause of the error",
                "enum": [
                  "HEADER_MALFORMED",
                  "HEADER_MISSING",
                  "TOKEN_AUDIENCE_NOT_ALLOWED",
                  "TOKEN_CREATION_FAILED",
                  "TOKEN_EXPIRED",
                  "TOKEN_KEY_ERROR",
                  "TOKEN_SIGN_ERROR",
                  "TOKEN_VERIFICATION_FAILED",
                  "GET_THIRD_PARTY_TOKEN_FAILED",
                  "WEBHOOK_VERIFY_SIGNATURE_FAILED"
                ]
              }
            }
          },
          "errorId": {
            "type": "string",
            "description": "uuid generated in order to track logs"
          }
        }
      },
      "ConflictErrorPayloadConflict": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Code of the error",
            "enum": [
              "CONFLICT_ERROR",
              "RESOURCE_NOT_AVAILABLE"
            ]
          },
          "details": {
            "type": "object",
            "properties": {
              "cause": {
                "type": "string",
                "description": "Specific cause of the error",
                "enum": [
                  "PAYLOAD_CONFLICT"
                ]
              }
            }
          },
          "errorId": {
            "type": "string",
            "description": "uuid generated in order to track logs"
          }
        }
      },
      "2HireBoardRegistrationSchema": {
        "type": "object",
        "title": "2hire Box",
        "properties": {
          "connectivityProvider": {
            "type": "string",
            "description": "Vehicle Manufacturer",
            "enum": [
              "2HIRE_BOARD"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "qrCode": {
                "type": "string",
                "description": "2hireBox identifier of the vehicle"
              },
              "profileId": {
                "type": "string",
                "description": "Id of the vehicle profile"
              }
            },
            "required": [
              "qrCode",
              "profileId"
            ]
          }
        }
      }
    }
  }
}
```